fleeksoft-io
0.0.8indexedPort of JDK's IO classes for cross-platform support, facilitating Java-style IO operations. Offers modules for buffer, charset, URI handling, and seamless integration with kotlinx-io and Okio.
Port of JDK's IO classes for cross-platform support, facilitating Java-style IO operations. Offers modules for buffer, charset, URI handling, and seamless integration with kotlinx-io and Okio.
A Kotlin Multiplatform (KMP) port of Java’s IO classes, bringing familiar IO operations to multiplatform projects—JVM, Android, iOS, macOS, Linux, Windows, Web, and beyond.
This library is organized into modular components for flexibility and clarity.
Note Direct file read/write APIs are not included. For file operations, use this library in combination with
kotlinx-ioorokio, which support stream conversions.
com.fleeksoft.io:io-core)Core buffers plus the main stream/reader implementations and extensions.
com.fleeksoft.io:io)Charset-aware reader adapter and InputStream extensions.
InputStreamReaderval byteArrayInputStream: ByteArrayInputStream = "...".byteInputStream(Charsets.UTF8)
inputStreamReader: InputStreamReader = inputStream.reader(Charsets.UTF8)
bufferReader: BufferedReader = inputStream.bufferedReader(Charsets.UTF8)
com.fleeksoft.io:uri)Multiplatform-safe version of java.net.URI.
URI: Parse, resolve, normalize URIsURIFactory: Use this instead of URI.create()com.fleeksoft.io:kotlinx-io)Interop for working with kotlinx-io streams:
Source.asInputStream(): InputStreamRawSource.asInputStream(): InputStreamInputStream.asSource(): RawSourcecom.fleeksoft.io:okio)Interop for Okio-powered IO:
Source.asInputStream(): InputStreamInputStream.asSource(): SourceSupport for standard and extended character sets:
com.fleeksoft.charset:charset:<version>com.fleeksoft.charset:charset-ext:<version>➡️ More info
Add dependencies in your build.gradle.kts:
commonMain.dependencies {
implementation("com.fleeksoft.io:io-core:<version>")
implementation("com.fleeksoft.io:io:<version>")
// Optional integrations
implementation("com.fleeksoft.io:kotlinx-io:<version>")
implementation("com.fleeksoft.io:okio:<version>")
}
val str = "Hello, World!"
val byteArray = ByteArray(10)
val charArray = CharArray(10)
val byteArrayInputStream = str.byteInputStream()
val stringReader = str.reader()
val bufferedReader = stringReader.buffered()
val bufferedReader2 = byteArrayInputStream.bufferedReader()
val byteBuffer = ByteBufferFactory.wrap(byteArray)
val charBuffer = CharBufferFactory.wrap(charArray)
Contributions are welcome! Open an issue or submit a pull request to improve features, fix bugs, or enhance documentation.
Licensed under the Apache License 2.0. See LICENSE for full details.
Buffer: Base container (like java.nio.Buffer)ByteBuffer, CharBufferByteBufferFactory, CharBufferFactory: Helper utilities to create buffersInputStream, OutputStream, Reader, BufferedReaderByteArrayInputStream, ByteArrayOutputStream, BufferedInputStream, BufferedOutputStreamFilterInputStream, FilterOutputStream, FilterReader, PushbackReaderStringReader, CharArrayReaderCloseable, Readable, Flushable: Interfaces for IO components"Hello".byteInputStream(), "Hello".reader()byteArray.inputStream()reader.buffered(), reader.readLines(), reader.readString(count)Surfaced from shared tags and platforms — no rankings paid for.