diff --git a/README.md b/README.md index 31d3e03dd..3dd2eb917 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,10 @@ [![Kotlin Alpha](https://kotl.in/badges/alpha.svg)](https://kotlinlang.org/docs/components-stability.html) [![JetBrains incubator project](https://jb.gg/badges/incubator.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub) [![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) +[![Download](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-io-core/0.2.0)](https://central.sonatype.com/artifact/org.jetbrains.kotlinx/kotlinx-io-core/0.2.0) [![Kotlin](https://img.shields.io/badge/kotlin-1.8.21-blue.svg?logo=kotlin)](http://kotlinlang.org) [![TeamCity build](https://img.shields.io/teamcity/build/s/KotlinTools_KotlinxIo_BuildAggregated.svg?server=http%3A%2F%2Fteamcity.jetbrains.com)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=KotlinTools_KotlinxIo_BuildAggregated&guest=1) +[![KDoc link](https://img.shields.io/badge/API_reference-KDoc-blue)](https://fzhinkin.github.io/kotlinx-io-dokka-docs-preview/) A multiplatform Kotlin library providing basic IO primitives. `kotlinx-io` is based on [Okio](https://github.com/square/okio) but does not preserve backward compatibility with it. @@ -17,6 +19,12 @@ The library is built around `Buffer` - a mutable sequence of bytes. `Buffer` wor The library also provides interfaces representing data sources and destinations - `Source` and `Sink`. +In addition to `Buffer`, the library provides an immutable sequence of bytes - `ByteString`. + +There are two `kotlinx-io` modules: +- [kotlinx-io-bytestring](./bytestring) - provides `ByteString`. +- [kotlinx-io-core](./core) - provides IO primitives (`Buffer`, `Source`, `Sink`), depends on `kotlinx-io-bytestring`. + ## Using in your projects > Note that the library is experimental, and the API is subject to change. @@ -24,16 +32,29 @@ The library also provides interfaces representing data sources and destinations ### Gradle Make sure that you have `mavenCentral()` in the list of repositories: -``` +```kotlin repositories { mavenCentral() } ``` Add the library to dependencies: -``` +```kotlin dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-io:0.2.0-alpha-dev1") + implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.2.0") +} +``` + +In multiplatform projects, add a dependency to the `commonMain` source set dependencies: +```kotlin +kotlin { + sourceSets { + commonMain { + dependencies { + implementation("org.jetbrains.kotlinx:kotlinx-io:0.2.0") + } + } + } } ``` @@ -43,8 +64,8 @@ Add the library to dependencies: ```xml org.jetbrains.kotlinx - kotlinx-io - 0.2.0-alpha-dev1 + kotlinx-io-core + 0.2.0 ```