From 6a7506fb3e97473fb38ea9a02e1b29d8e4d652ba Mon Sep 17 00:00:00 2001 From: Art Shendrik Date: Thu, 27 Jun 2024 21:54:04 +0100 Subject: [PATCH] feat: API dump Signed-off-by: Art Shendrik --- dependencies/classpath.txt | 4 +- fluxo-io-rad/api/android/fluxo-io-rad.api | 174 ++++++++++++++++++ fluxo-io-rad/api/fluxo-io-rad.klib.api | 50 +++++ fluxo-io-rad/api/jvm/fluxo-io-rad.api | 174 ++++++++++++++++++ fluxo-io-rad/build.gradle.kts | 17 +- .../fluxo/io/internal/BasicRad.commonJvm.kt | 10 +- .../io/nio/CoroutineAsynchronousChannel.kt | 9 + .../fluxo/io/rad/ByteArrayRad.commonJvm.kt | 5 +- .../kotlin/fluxo/io/rad/ByteBufferRad.kt | 3 +- .../io/rad/RandomAccessData.commonJvm.kt | 3 + .../fluxo/io/util/{Util.kt => IoUtil.kt} | 5 +- gradle/libs.versions.toml | 22 ++- 12 files changed, 454 insertions(+), 22 deletions(-) create mode 100644 fluxo-io-rad/api/fluxo-io-rad.klib.api rename fluxo-io-rad/src/commonMain/kotlin/fluxo/io/util/{Util.kt => IoUtil.kt} (98%) diff --git a/dependencies/classpath.txt b/dependencies/classpath.txt index f282779..16a526a 100644 --- a/dependencies/classpath.txt +++ b/dependencies/classpath.txt @@ -185,11 +185,11 @@ org.jetbrains.kotlin:kotlin-stdlib:1.9.22 org.jetbrains.kotlin:kotlin-tooling-core:2.0.20-Beta1 org.jetbrains.kotlin:kotlin-util-io:2.0.20-Beta1 org.jetbrains.kotlin:kotlin-util-klib:2.0.20-Beta1 -org.jetbrains.kotlinx.binary-compatibility-validator:org.jetbrains.kotlinx.binary-compatibility-validator.gradle.plugin:0.15.0-Beta.2 +org.jetbrains.kotlinx.binary-compatibility-validator:org.jetbrains.kotlinx.binary-compatibility-validator.gradle.plugin:0.15.0-Beta.3 org.jetbrains.kotlinx.kover:org.jetbrains.kotlinx.kover.gradle.plugin:0.8.1 org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.24.0 org.jetbrains.kotlinx:atomicfu-transformer:0.24.0 -org.jetbrains.kotlinx:binary-compatibility-validator:0.15.0-Beta.2 +org.jetbrains.kotlinx:binary-compatibility-validator:0.15.0-Beta.3 org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0 org.jetbrains.kotlinx:kotlinx-html-jvm:0.8.1 org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.7.0 diff --git a/fluxo-io-rad/api/android/fluxo-io-rad.api b/fluxo-io-rad/api/android/fluxo-io-rad.api index e69de29..d3b6b63 100644 --- a/fluxo-io-rad/api/android/fluxo-io-rad.api +++ b/fluxo-io-rad/api/android/fluxo-io-rad.api @@ -0,0 +1,174 @@ +public final class fluxo/io/FluxoIoLogger { + public static final fun setLogger (Lkotlin/jvm/functions/Function2;)V +} + +public abstract class fluxo/io/SharedCloseable : java/io/Closeable { + public fun ()V + public final fun close ()V + public final fun isOpen ()Z + protected abstract fun onSharedClose ()V + public final fun onSharedClose (Lkotlin/jvm/functions/Function1;)Lkotlinx/coroutines/DisposableHandle; + public final fun retain ()V +} + +public final class fluxo/io/nio/AsynchronousFileChannelUtil { + public static final synthetic fun aAccept (Ljava/nio/channels/AsynchronousServerSocketChannel;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun aConnect (Ljava/nio/channels/AsynchronousSocketChannel;Ljava/net/SocketAddress;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun aLock (Ljava/nio/channels/AsynchronousFileChannel;JJZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun aLock (Ljava/nio/channels/AsynchronousFileChannel;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun aRead (Ljava/nio/channels/AsynchronousFileChannel;Ljava/nio/ByteBuffer;JLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun aRead (Ljava/nio/channels/AsynchronousSocketChannel;Ljava/nio/ByteBuffer;JLjava/util/concurrent/TimeUnit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun aRead$default (Ljava/nio/channels/AsynchronousSocketChannel;Ljava/nio/ByteBuffer;JLjava/util/concurrent/TimeUnit;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final synthetic fun aWrite (Ljava/nio/channels/AsynchronousFileChannel;Ljava/nio/ByteBuffer;JLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun aWrite (Ljava/nio/channels/AsynchronousSocketChannel;Ljava/nio/ByteBuffer;JLjava/util/concurrent/TimeUnit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun aWrite$default (Ljava/nio/channels/AsynchronousSocketChannel;Ljava/nio/ByteBuffer;JLjava/util/concurrent/TimeUnit;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; +} + +public final class fluxo/io/nio/BufferUtil { + public static final field EMPTY_BYTE_BUFFER Ljava/nio/ByteBuffer; + public static final fun releaseCompat (Ljava/nio/Buffer;)Ljava/nio/ByteBuffer; +} + +public final class fluxo/io/rad/Rad { + public static final fun asInputStream (Lfluxo/io/rad/RandomAccessData;)Ljava/io/InputStream; + public static final fun asInputStreamOld (Lfluxo/io/rad/RandomAccessData;)Ljava/io/InputStream; + public static final fun forArray ([B)Lfluxo/io/rad/RandomAccessData; + public static final fun forArray ([BI)Lfluxo/io/rad/RandomAccessData; + public static final fun forArray ([BII)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forArray$default ([BIIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forAsyncFileChannel (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forAsyncFileChannel (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forAsyncFileChannel (Ljava/io/File;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forAsyncFileChannel (Ljava/nio/channels/AsynchronousFileChannel;)Lfluxo/io/rad/RandomAccessData; + public static final fun forAsyncFileChannel (Ljava/nio/channels/AsynchronousFileChannel;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forAsyncFileChannel (Ljava/nio/channels/AsynchronousFileChannel;JJ)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forAsyncFileChannel$default (Ljava/io/File;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forAsyncFileChannel$default (Ljava/nio/channels/AsynchronousFileChannel;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/File;JI)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/FileDescriptor;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/FileDescriptor;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/FileDescriptor;JI)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/FileInputStream;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/FileInputStream;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/FileInputStream;JI)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/nio/ByteBuffer;II[Ljava/lang/AutoCloseable;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/nio/ByteBuffer;I[Ljava/lang/AutoCloseable;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/nio/ByteBuffer;[Ljava/lang/AutoCloseable;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/nio/channels/FileChannel;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/nio/channels/FileChannel;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/nio/channels/FileChannel;JI)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer ([B)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer ([BI)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer ([BII)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteBuffer$default (Ljava/io/File;JIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteBuffer$default (Ljava/io/FileDescriptor;JIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteBuffer$default (Ljava/io/FileInputStream;JIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteBuffer$default (Ljava/nio/ByteBuffer;II[Ljava/lang/AutoCloseable;ILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteBuffer$default (Ljava/nio/channels/FileChannel;JIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteBuffer$default ([BIIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteChannelFactory (JJJILkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteChannelFactory (JJJLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteChannelFactory (JJLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteChannelFactory (JLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteChannelFactory$default (JJJILkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forDataInputFactory (JJJILkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forDataInputFactory (JJJLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forDataInputFactory (JJLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forDataInputFactory (JLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forDataInputFactory$default (JJJILkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/File;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/File;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/FileDescriptor;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/FileDescriptor;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/FileDescriptor;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/FileInputStream;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/FileInputStream;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/FileInputStream;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/RandomAccessFile;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/RandomAccessFile;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/RandomAccessFile;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/nio/channels/FileChannel;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/nio/channels/FileChannel;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/nio/channels/FileChannel;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/nio/channels/FileChannel;JJ[Ljava/lang/AutoCloseable;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forFileChannel$default (Ljava/io/File;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forFileChannel$default (Ljava/io/File;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forFileChannel$default (Ljava/io/FileDescriptor;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forFileChannel$default (Ljava/io/FileInputStream;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forFileChannel$default (Ljava/io/RandomAccessFile;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forFileChannel$default (Ljava/nio/channels/FileChannel;JJ[Ljava/lang/AutoCloseable;ILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forInputStreamFactory (JJJILkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forInputStreamFactory (JJJLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forInputStreamFactory (JJLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forInputStreamFactory (JLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forInputStreamFactory$default (JJJILkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forMemoryMappedFile (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forMemoryMappedFile (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forMemoryMappedFile (Ljava/io/File;JI)Lfluxo/io/rad/RandomAccessData; + public static final fun forMemoryMappedFile (Ljava/nio/channels/FileChannel;)Lfluxo/io/rad/RandomAccessData; + public static final fun forMemoryMappedFile (Ljava/nio/channels/FileChannel;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forMemoryMappedFile (Ljava/nio/channels/FileChannel;JI)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forMemoryMappedFile$default (Ljava/io/File;JIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forMemoryMappedFile$default (Ljava/nio/channels/FileChannel;JIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/File;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/FileDescriptor;)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/FileDescriptor;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/FileDescriptor;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/FileInputStream;)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/FileInputStream;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/FileInputStream;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/nio/channels/SeekableByteChannel;)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/nio/channels/SeekableByteChannel;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/nio/channels/SeekableByteChannel;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/nio/channels/SeekableByteChannel;JJ[Ljava/lang/AutoCloseable;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forSeekableByteChannel$default (Ljava/io/File;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forSeekableByteChannel$default (Ljava/io/FileDescriptor;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forSeekableByteChannel$default (Ljava/io/FileInputStream;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forSeekableByteChannel$default (Ljava/nio/channels/SeekableByteChannel;JJ[Ljava/lang/AutoCloseable;ILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forStreamFactory (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forStreamFactory (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forStreamFactory (Ljava/io/File;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forStreamFactory (Ljava/io/File;JJI)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forStreamFactory$default (Ljava/io/File;JJIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; +} + +public abstract interface class fluxo/io/rad/RandomAccessData : java/io/Closeable, java/lang/AutoCloseable { + public abstract fun asInputStream ()Ljava/io/InputStream; + public abstract fun getSize ()J + public abstract fun read (Ljava/nio/ByteBuffer;J)I + public abstract fun read ([BJII)I + public static synthetic fun read$default (Lfluxo/io/rad/RandomAccessData;[BJIIILjava/lang/Object;)I + public abstract fun readAllBytes ()[B + public abstract synthetic fun readAsync (Ljava/nio/ByteBuffer;JLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract synthetic fun readAsync ([BJIILkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun readAsync$default (Lfluxo/io/rad/RandomAccessData;[BJIILkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public abstract fun readByteAt (J)I + public abstract fun readFrom (JI)[B + public static synthetic fun readFrom$default (Lfluxo/io/rad/RandomAccessData;JIILjava/lang/Object;)[B + public abstract fun readFully ([BJII)I + public static synthetic fun readFully$default (Lfluxo/io/rad/RandomAccessData;[BJIIILjava/lang/Object;)I + public abstract synthetic fun readFullyAsync ([BJIILkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun readFullyAsync$default (Lfluxo/io/rad/RandomAccessData;[BJIILkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public abstract fun subsection (JJ)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun subsection$default (Lfluxo/io/rad/RandomAccessData;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public abstract fun transferTo (Ljava/io/OutputStream;I)J + public abstract fun transferTo (Ljava/nio/channels/WritableByteChannel;IZ)J + public static synthetic fun transferTo$default (Lfluxo/io/rad/RandomAccessData;Ljava/io/OutputStream;IILjava/lang/Object;)J + public static synthetic fun transferTo$default (Lfluxo/io/rad/RandomAccessData;Ljava/nio/channels/WritableByteChannel;IZILjava/lang/Object;)J +} + +public final class fluxo/io/util/IoUtil { + public static final field EMPTY_AUTO_CLOSEABLE_ARRAY [Ljava/lang/AutoCloseable; + public static final field EMPTY_BYTE_ARRAY [B + public static final fun checkOffsetAndCount (III)V + public static final fun checkOffsetAndCount (JJJ)V +} + diff --git a/fluxo-io-rad/api/fluxo-io-rad.klib.api b/fluxo-io-rad/api/fluxo-io-rad.klib.api new file mode 100644 index 0000000..3252bf7 --- /dev/null +++ b/fluxo-io-rad/api/fluxo-io-rad.klib.api @@ -0,0 +1,50 @@ +// Klib ABI Dump +// Targets: [androidNativeArm32, androidNativeArm64, androidNativeX64, androidNativeX86, iosArm64, iosSimulatorArm64, iosX64, js, linuxArm64, linuxX64, macosArm64, macosX64, mingwX64, tvosArm64, tvosSimulatorArm64, tvosX64, wasmJs, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64, watchosX64] +// Rendering settings: +// - Signature version: 2 +// - Show manifest properties: true +// - Show declarations: true + +// Library unique name: +abstract interface fluxo.io.rad/RandomAccessData : kotlin/AutoCloseable { // fluxo.io.rad/RandomAccessData|null[0] + abstract val size // fluxo.io.rad/RandomAccessData.size|{}size[0] + abstract fun (): kotlin/Long // fluxo.io.rad/RandomAccessData.size.|(){}[0] + + abstract fun read(kotlin/ByteArray, kotlin/Long = ..., kotlin/Int = ..., kotlin/Int = ...): kotlin/Int // fluxo.io.rad/RandomAccessData.read|read(kotlin.ByteArray;kotlin.Long;kotlin.Int;kotlin.Int){}[0] + abstract fun readAllBytes(): kotlin/ByteArray // fluxo.io.rad/RandomAccessData.readAllBytes|readAllBytes(){}[0] + abstract fun readFrom(kotlin/Long, kotlin/Int = ...): kotlin/ByteArray // fluxo.io.rad/RandomAccessData.readFrom|readFrom(kotlin.Long;kotlin.Int){}[0] + abstract fun readFully(kotlin/ByteArray, kotlin/Long = ..., kotlin/Int = ..., kotlin/Int = ...): kotlin/Int // fluxo.io.rad/RandomAccessData.readFully|readFully(kotlin.ByteArray;kotlin.Long;kotlin.Int;kotlin.Int){}[0] + abstract fun subsection(kotlin/Long, kotlin/Long = ...): fluxo.io.rad/RandomAccessData // fluxo.io.rad/RandomAccessData.subsection|subsection(kotlin.Long;kotlin.Long){}[0] + abstract suspend fun readAsync(kotlin/ByteArray, kotlin/Long = ..., kotlin/Int = ..., kotlin/Int = ...): kotlin/Int // fluxo.io.rad/RandomAccessData.readAsync|readAsync(kotlin.ByteArray;kotlin.Long;kotlin.Int;kotlin.Int){}[0] + abstract suspend fun readFullyAsync(kotlin/ByteArray, kotlin/Long = ..., kotlin/Int = ..., kotlin/Int = ...): kotlin/Int // fluxo.io.rad/RandomAccessData.readFullyAsync|readFullyAsync(kotlin.ByteArray;kotlin.Long;kotlin.Int;kotlin.Int){}[0] +} + +abstract class fluxo.io/SharedCloseable : kotlin/AutoCloseable { // fluxo.io/SharedCloseable|null[0] + constructor () // fluxo.io/SharedCloseable.|(){}[0] + + final val isOpen // fluxo.io/SharedCloseable.isOpen|{}isOpen[0] + final fun (): kotlin/Boolean // fluxo.io/SharedCloseable.isOpen.|(){}[0] + + abstract fun onSharedClose() // fluxo.io/SharedCloseable.onSharedClose|onSharedClose(){}[0] + final fun close() // fluxo.io/SharedCloseable.close|close(){}[0] + final fun onSharedClose(kotlin/Function1): kotlinx.coroutines/DisposableHandle // fluxo.io/SharedCloseable.onSharedClose|onSharedClose(kotlin.Function1){}[0] + final fun retain() // fluxo.io/SharedCloseable.retain|retain(){}[0] +} + +open class fluxo.io/EOFException : fluxo.io/IOException { // fluxo.io/EOFException|null[0] + constructor (kotlin/String) // fluxo.io/EOFException.|(kotlin.String){}[0] +} + +open class fluxo.io/IOException : kotlin/Exception { // fluxo.io/IOException|null[0] + constructor (kotlin/String) // fluxo.io/IOException.|(kotlin.String){}[0] +} + +final val fluxo.io.util/EMPTY_AUTO_CLOSEABLE_ARRAY // fluxo.io.util/EMPTY_AUTO_CLOSEABLE_ARRAY|{}EMPTY_AUTO_CLOSEABLE_ARRAY[0] + final fun (): kotlin/Array // fluxo.io.util/EMPTY_AUTO_CLOSEABLE_ARRAY.|(){}[0] +final val fluxo.io.util/EMPTY_BYTE_ARRAY // fluxo.io.util/EMPTY_BYTE_ARRAY|{}EMPTY_BYTE_ARRAY[0] + final fun (): kotlin/ByteArray // fluxo.io.util/EMPTY_BYTE_ARRAY.|(){}[0] + +final fun fluxo.io.rad/RadByteArrayAccessor(kotlin/ByteArray, kotlin/Int = ..., kotlin/Int = ...): fluxo.io.rad/RandomAccessData // fluxo.io.rad/RadByteArrayAccessor|RadByteArrayAccessor(kotlin.ByteArray;kotlin.Int;kotlin.Int){}[0] +final fun fluxo.io.util/checkOffsetAndCount(kotlin/Int, kotlin/Int, kotlin/Int) // fluxo.io.util/checkOffsetAndCount|checkOffsetAndCount(kotlin.Int;kotlin.Int;kotlin.Int){}[0] +final fun fluxo.io.util/checkOffsetAndCount(kotlin/Long, kotlin/Long, kotlin/Long) // fluxo.io.util/checkOffsetAndCount|checkOffsetAndCount(kotlin.Long;kotlin.Long;kotlin.Long){}[0] +final fun fluxo.io/setFluxoIoLogger(kotlin/Function2) // fluxo.io/setFluxoIoLogger|setFluxoIoLogger(kotlin.Function2){}[0] diff --git a/fluxo-io-rad/api/jvm/fluxo-io-rad.api b/fluxo-io-rad/api/jvm/fluxo-io-rad.api index e69de29..d3b6b63 100644 --- a/fluxo-io-rad/api/jvm/fluxo-io-rad.api +++ b/fluxo-io-rad/api/jvm/fluxo-io-rad.api @@ -0,0 +1,174 @@ +public final class fluxo/io/FluxoIoLogger { + public static final fun setLogger (Lkotlin/jvm/functions/Function2;)V +} + +public abstract class fluxo/io/SharedCloseable : java/io/Closeable { + public fun ()V + public final fun close ()V + public final fun isOpen ()Z + protected abstract fun onSharedClose ()V + public final fun onSharedClose (Lkotlin/jvm/functions/Function1;)Lkotlinx/coroutines/DisposableHandle; + public final fun retain ()V +} + +public final class fluxo/io/nio/AsynchronousFileChannelUtil { + public static final synthetic fun aAccept (Ljava/nio/channels/AsynchronousServerSocketChannel;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun aConnect (Ljava/nio/channels/AsynchronousSocketChannel;Ljava/net/SocketAddress;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun aLock (Ljava/nio/channels/AsynchronousFileChannel;JJZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun aLock (Ljava/nio/channels/AsynchronousFileChannel;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun aRead (Ljava/nio/channels/AsynchronousFileChannel;Ljava/nio/ByteBuffer;JLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun aRead (Ljava/nio/channels/AsynchronousSocketChannel;Ljava/nio/ByteBuffer;JLjava/util/concurrent/TimeUnit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun aRead$default (Ljava/nio/channels/AsynchronousSocketChannel;Ljava/nio/ByteBuffer;JLjava/util/concurrent/TimeUnit;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final synthetic fun aWrite (Ljava/nio/channels/AsynchronousFileChannel;Ljava/nio/ByteBuffer;JLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun aWrite (Ljava/nio/channels/AsynchronousSocketChannel;Ljava/nio/ByteBuffer;JLjava/util/concurrent/TimeUnit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun aWrite$default (Ljava/nio/channels/AsynchronousSocketChannel;Ljava/nio/ByteBuffer;JLjava/util/concurrent/TimeUnit;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; +} + +public final class fluxo/io/nio/BufferUtil { + public static final field EMPTY_BYTE_BUFFER Ljava/nio/ByteBuffer; + public static final fun releaseCompat (Ljava/nio/Buffer;)Ljava/nio/ByteBuffer; +} + +public final class fluxo/io/rad/Rad { + public static final fun asInputStream (Lfluxo/io/rad/RandomAccessData;)Ljava/io/InputStream; + public static final fun asInputStreamOld (Lfluxo/io/rad/RandomAccessData;)Ljava/io/InputStream; + public static final fun forArray ([B)Lfluxo/io/rad/RandomAccessData; + public static final fun forArray ([BI)Lfluxo/io/rad/RandomAccessData; + public static final fun forArray ([BII)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forArray$default ([BIIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forAsyncFileChannel (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forAsyncFileChannel (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forAsyncFileChannel (Ljava/io/File;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forAsyncFileChannel (Ljava/nio/channels/AsynchronousFileChannel;)Lfluxo/io/rad/RandomAccessData; + public static final fun forAsyncFileChannel (Ljava/nio/channels/AsynchronousFileChannel;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forAsyncFileChannel (Ljava/nio/channels/AsynchronousFileChannel;JJ)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forAsyncFileChannel$default (Ljava/io/File;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forAsyncFileChannel$default (Ljava/nio/channels/AsynchronousFileChannel;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/File;JI)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/FileDescriptor;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/FileDescriptor;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/FileDescriptor;JI)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/FileInputStream;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/FileInputStream;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/io/FileInputStream;JI)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/nio/ByteBuffer;II[Ljava/lang/AutoCloseable;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/nio/ByteBuffer;I[Ljava/lang/AutoCloseable;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/nio/ByteBuffer;[Ljava/lang/AutoCloseable;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/nio/channels/FileChannel;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/nio/channels/FileChannel;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer (Ljava/nio/channels/FileChannel;JI)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer ([B)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer ([BI)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteBuffer ([BII)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteBuffer$default (Ljava/io/File;JIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteBuffer$default (Ljava/io/FileDescriptor;JIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteBuffer$default (Ljava/io/FileInputStream;JIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteBuffer$default (Ljava/nio/ByteBuffer;II[Ljava/lang/AutoCloseable;ILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteBuffer$default (Ljava/nio/channels/FileChannel;JIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteBuffer$default ([BIIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteChannelFactory (JJJILkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteChannelFactory (JJJLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteChannelFactory (JJLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forByteChannelFactory (JLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forByteChannelFactory$default (JJJILkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forDataInputFactory (JJJILkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forDataInputFactory (JJJLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forDataInputFactory (JJLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forDataInputFactory (JLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forDataInputFactory$default (JJJILkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/File;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/File;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/FileDescriptor;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/FileDescriptor;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/FileDescriptor;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/FileInputStream;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/FileInputStream;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/FileInputStream;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/RandomAccessFile;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/RandomAccessFile;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/io/RandomAccessFile;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/nio/channels/FileChannel;)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/nio/channels/FileChannel;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/nio/channels/FileChannel;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forFileChannel (Ljava/nio/channels/FileChannel;JJ[Ljava/lang/AutoCloseable;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forFileChannel$default (Ljava/io/File;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forFileChannel$default (Ljava/io/File;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forFileChannel$default (Ljava/io/FileDescriptor;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forFileChannel$default (Ljava/io/FileInputStream;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forFileChannel$default (Ljava/io/RandomAccessFile;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forFileChannel$default (Ljava/nio/channels/FileChannel;JJ[Ljava/lang/AutoCloseable;ILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forInputStreamFactory (JJJILkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forInputStreamFactory (JJJLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forInputStreamFactory (JJLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static final fun forInputStreamFactory (JLkotlin/jvm/functions/Function0;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forInputStreamFactory$default (JJJILkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forMemoryMappedFile (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forMemoryMappedFile (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forMemoryMappedFile (Ljava/io/File;JI)Lfluxo/io/rad/RandomAccessData; + public static final fun forMemoryMappedFile (Ljava/nio/channels/FileChannel;)Lfluxo/io/rad/RandomAccessData; + public static final fun forMemoryMappedFile (Ljava/nio/channels/FileChannel;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forMemoryMappedFile (Ljava/nio/channels/FileChannel;JI)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forMemoryMappedFile$default (Ljava/io/File;JIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forMemoryMappedFile$default (Ljava/nio/channels/FileChannel;JIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/File;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/FileDescriptor;)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/FileDescriptor;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/FileDescriptor;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/FileInputStream;)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/FileInputStream;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/io/FileInputStream;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/nio/channels/SeekableByteChannel;)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/nio/channels/SeekableByteChannel;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/nio/channels/SeekableByteChannel;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forSeekableByteChannel (Ljava/nio/channels/SeekableByteChannel;JJ[Ljava/lang/AutoCloseable;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forSeekableByteChannel$default (Ljava/io/File;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forSeekableByteChannel$default (Ljava/io/FileDescriptor;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forSeekableByteChannel$default (Ljava/io/FileInputStream;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forSeekableByteChannel$default (Ljava/nio/channels/SeekableByteChannel;JJ[Ljava/lang/AutoCloseable;ILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public static final fun forStreamFactory (Ljava/io/File;)Lfluxo/io/rad/RandomAccessData; + public static final fun forStreamFactory (Ljava/io/File;J)Lfluxo/io/rad/RandomAccessData; + public static final fun forStreamFactory (Ljava/io/File;JJ)Lfluxo/io/rad/RandomAccessData; + public static final fun forStreamFactory (Ljava/io/File;JJI)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun forStreamFactory$default (Ljava/io/File;JJIILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; +} + +public abstract interface class fluxo/io/rad/RandomAccessData : java/io/Closeable, java/lang/AutoCloseable { + public abstract fun asInputStream ()Ljava/io/InputStream; + public abstract fun getSize ()J + public abstract fun read (Ljava/nio/ByteBuffer;J)I + public abstract fun read ([BJII)I + public static synthetic fun read$default (Lfluxo/io/rad/RandomAccessData;[BJIIILjava/lang/Object;)I + public abstract fun readAllBytes ()[B + public abstract synthetic fun readAsync (Ljava/nio/ByteBuffer;JLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract synthetic fun readAsync ([BJIILkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun readAsync$default (Lfluxo/io/rad/RandomAccessData;[BJIILkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public abstract fun readByteAt (J)I + public abstract fun readFrom (JI)[B + public static synthetic fun readFrom$default (Lfluxo/io/rad/RandomAccessData;JIILjava/lang/Object;)[B + public abstract fun readFully ([BJII)I + public static synthetic fun readFully$default (Lfluxo/io/rad/RandomAccessData;[BJIIILjava/lang/Object;)I + public abstract synthetic fun readFullyAsync ([BJIILkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun readFullyAsync$default (Lfluxo/io/rad/RandomAccessData;[BJIILkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public abstract fun subsection (JJ)Lfluxo/io/rad/RandomAccessData; + public static synthetic fun subsection$default (Lfluxo/io/rad/RandomAccessData;JJILjava/lang/Object;)Lfluxo/io/rad/RandomAccessData; + public abstract fun transferTo (Ljava/io/OutputStream;I)J + public abstract fun transferTo (Ljava/nio/channels/WritableByteChannel;IZ)J + public static synthetic fun transferTo$default (Lfluxo/io/rad/RandomAccessData;Ljava/io/OutputStream;IILjava/lang/Object;)J + public static synthetic fun transferTo$default (Lfluxo/io/rad/RandomAccessData;Ljava/nio/channels/WritableByteChannel;IZILjava/lang/Object;)J +} + +public final class fluxo/io/util/IoUtil { + public static final field EMPTY_AUTO_CLOSEABLE_ARRAY [Ljava/lang/AutoCloseable; + public static final field EMPTY_BYTE_ARRAY [B + public static final fun checkOffsetAndCount (III)V + public static final fun checkOffsetAndCount (JJJ)V +} + diff --git a/fluxo-io-rad/build.gradle.kts b/fluxo-io-rad/build.gradle.kts index bd24af2..ee7fa31 100644 --- a/fluxo-io-rad/build.gradle.kts +++ b/fluxo-io-rad/build.gradle.kts @@ -1,5 +1,6 @@ plugins { alias(libs.plugins.kotlinx.kover) + alias(libs.plugins.kotlinx.bcv) alias(libs.plugins.atomicfu) } @@ -14,6 +15,11 @@ fkcSetupMultiplatform( setupCoroutines = true setupDependencies = true addStdlibDependency = true + apiValidation { + @Suppress("UnstableApiUsage") + klibValidationEnabled = false + tsApiChecks = false + } }, ) { common.main.dependencies { @@ -30,7 +36,7 @@ fkcSetupMultiplatform( val commonJs = commonJs commonJs.main.dependencies { - implementation(libs.kotlinx.atomicfu) + api(libs.kotlinx.atomicfu) } arrayOf(commonJvm, commonApple, commonJs, commonLinux, commonMingw).forEach { @@ -39,3 +45,12 @@ fkcSetupMultiplatform( } } } + +apiValidation { + ignoredPackages.add("fluxo.io.internal") + + @Suppress("OPT_IN_USAGE") + klib { + enabled = true + } +} diff --git a/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/internal/BasicRad.commonJvm.kt b/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/internal/BasicRad.commonJvm.kt index a9f291c..5467a75 100644 --- a/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/internal/BasicRad.commonJvm.kt +++ b/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/internal/BasicRad.commonJvm.kt @@ -6,8 +6,8 @@ import fluxo.io.nio.flipCompat import fluxo.io.nio.positionCompat import fluxo.io.nio.releaseCompat import fluxo.io.rad.InputStreamFromRad -import fluxo.io.rad.RadByteArrayAccessor import fluxo.io.rad.RandomAccessData +import fluxo.io.util.MAX_BYTE import fluxo.io.util.readAllBytesImpl import fluxo.io.util.readFullyAsyncImpl import fluxo.io.util.readFullyImpl @@ -53,12 +53,14 @@ internal actual abstract class BasicRad : RandomAccessData { } /** - * Default naive inefficient implementation of [RadByteArrayAccessor.readByteAt]. - * No bounds check here! + * Default naive inefficient implementation for the [readByteAt]. + * + * _No bounds check here! + * Already done in the [readByteAt] method._ */ @Suppress("MagicNumber") protected open fun readByteAt0(position: Long): Int = - readFrom(position, maxLength = 1)[0].toInt() and 0xFF + readFrom(position, maxLength = 1)[0].toInt() and MAX_BYTE @Blocking diff --git a/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/nio/CoroutineAsynchronousChannel.kt b/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/nio/CoroutineAsynchronousChannel.kt index 72b6d26..b4a3bb9 100644 --- a/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/nio/CoroutineAsynchronousChannel.kt +++ b/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/nio/CoroutineAsynchronousChannel.kt @@ -1,3 +1,4 @@ +@file:JvmName("AsynchronousFileChannelUtil") @file:Suppress("KDocUnresolvedReference") package fluxo.io.nio @@ -31,6 +32,7 @@ import kotlinx.coroutines.suspendCancellableCoroutine * is waiting, this function *closes the underlying channel* and immediately resumes * with [CancellationException]. */ +@JvmSynthetic @RequiresApi(26) public suspend fun AsynchronousFileChannel.aLock(): FileLock = suspendCancellableCoroutine { cont -> @@ -45,6 +47,7 @@ public suspend fun AsynchronousFileChannel.aLock(): FileLock = * is waiting, this function *closes the underlying channel* and immediately resumes * with [CancellationException]. */ +@JvmSynthetic @RequiresApi(26) public suspend fun AsynchronousFileChannel.aLock( position: Long, @@ -62,6 +65,7 @@ public suspend fun AsynchronousFileChannel.aLock( * is waiting, this function *closes the underlying channel* and immediately resumes * with [CancellationException]. */ +@JvmSynthetic @RequiresApi(26) public suspend fun AsynchronousFileChannel.aRead(buf: ByteBuffer, position: Long): Int = suspendCancellableCoroutine { cont -> @@ -76,6 +80,7 @@ public suspend fun AsynchronousFileChannel.aRead(buf: ByteBuffer, position: Long * is waiting, this function *closes the underlying channel* and immediately resumes * with [CancellationException]. */ +@JvmSynthetic @RequiresApi(26) public suspend fun AsynchronousFileChannel.aWrite(buf: ByteBuffer, position: Long): Int = suspendCancellableCoroutine { cont -> @@ -90,6 +95,7 @@ public suspend fun AsynchronousFileChannel.aWrite(buf: ByteBuffer, position: Lon * is waiting, this function *closes the underlying channel* and immediately resumes * with [CancellationException]. */ +@JvmSynthetic @RequiresApi(26) public suspend fun AsynchronousServerSocketChannel.aAccept(): AsynchronousSocketChannel = suspendCancellableCoroutine { cont -> @@ -104,6 +110,7 @@ public suspend fun AsynchronousServerSocketChannel.aAccept(): AsynchronousSocket * is waiting, this function *closes the underlying channel* and immediately resumes * with [CancellationException]. */ +@JvmSynthetic @RequiresApi(26) public suspend fun AsynchronousSocketChannel.aConnect(socketAddress: SocketAddress): Unit = suspendCancellableCoroutine { cont -> @@ -118,6 +125,7 @@ public suspend fun AsynchronousSocketChannel.aConnect(socketAddress: SocketAddre * is waiting, this function *closes the underlying channel* and immediately resumes * with [CancellationException]. */ +@JvmSynthetic @RequiresApi(26) public suspend fun AsynchronousSocketChannel.aRead( buf: ByteBuffer, timeout: Long = 0L, timeUnit: TimeUnit = TimeUnit.MILLISECONDS, @@ -133,6 +141,7 @@ public suspend fun AsynchronousSocketChannel.aRead( * is waiting, this function *closes the underlying channel* and immediately resumes * with [CancellationException]. */ +@JvmSynthetic @RequiresApi(26) public suspend fun AsynchronousSocketChannel.aWrite( buf: ByteBuffer, timeout: Long = 0L, timeUnit: TimeUnit = TimeUnit.MILLISECONDS, diff --git a/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/ByteArrayRad.commonJvm.kt b/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/ByteArrayRad.commonJvm.kt index 0dc9425..096d0dc 100644 --- a/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/ByteArrayRad.commonJvm.kt +++ b/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/ByteArrayRad.commonJvm.kt @@ -1,8 +1,9 @@ package fluxo.io.rad import fluxo.io.internal.BasicRad -import fluxo.io.util.EMPTY_BYTE_ARRAY import fluxo.io.internal.ThreadSafe +import fluxo.io.util.EMPTY_BYTE_ARRAY +import fluxo.io.util.MAX_BYTE import fluxo.io.util.checkOffsetAndCount import fluxo.io.util.checkPosOffsetAndMaxLength import fluxo.io.util.checkPositionAndMaxLength @@ -80,7 +81,7 @@ actual constructor( @Suppress("MagicNumber") override fun readByteAt0(position: Long): Int = - array[offset + position.toInt()].toInt() and 0xFF + array[offset + position.toInt()].toInt() and MAX_BYTE override fun read(buffer: ByteBuffer, position: Long): Int { diff --git a/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/ByteBufferRad.kt b/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/ByteBufferRad.kt index d6658ad..5706bd6 100644 --- a/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/ByteBufferRad.kt +++ b/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/ByteBufferRad.kt @@ -8,6 +8,7 @@ import fluxo.io.nio.positionCompat import fluxo.io.nio.releaseCompat import fluxo.io.rad.ByteBufferRad.ByteBufferAccess import fluxo.io.util.EMPTY_AUTO_CLOSEABLE_ARRAY +import fluxo.io.util.MAX_BYTE import fluxo.io.util.toIntChecked import java.nio.ByteBuffer import java.nio.channels.FileChannel @@ -48,7 +49,7 @@ private constructor(access: ByteBufferAccess, offset: Int, size: Int) : override fun readByteAt0(position: Long): Int = - access.api.get(toAccessPos(position)).toInt() and 0xFF + access.api.get(toAccessPos(position)).toInt() and MAX_BYTE @Throws(IOException::class) override fun read(buffer: ByteBuffer, position: Long): Int { diff --git a/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/RandomAccessData.commonJvm.kt b/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/RandomAccessData.commonJvm.kt index c672ecb..d6108f4 100644 --- a/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/RandomAccessData.commonJvm.kt +++ b/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/RandomAccessData.commonJvm.kt @@ -86,6 +86,7 @@ public actual interface RandomAccessData : Closeable, AutoCloseable { public fun readByteAt(position: Long): Int + @JvmSynthetic public actual suspend fun readAsync( buffer: ByteArray, position: Long, @@ -93,6 +94,7 @@ public actual interface RandomAccessData : Closeable, AutoCloseable { maxLength: Int, ): Int + @JvmSynthetic public actual suspend fun readFullyAsync( buffer: ByteArray, position: Long, @@ -138,6 +140,7 @@ public actual interface RandomAccessData : Closeable, AutoCloseable { * @see java.nio.channels.AsynchronousFileChannel.read * @see java.nio.channels.AsynchronousByteChannel.read */ + @JvmSynthetic public suspend fun readAsync(buffer: ByteBuffer, position: Long): Int diff --git a/fluxo-io-rad/src/commonMain/kotlin/fluxo/io/util/Util.kt b/fluxo-io-rad/src/commonMain/kotlin/fluxo/io/util/IoUtil.kt similarity index 98% rename from fluxo-io-rad/src/commonMain/kotlin/fluxo/io/util/Util.kt rename to fluxo-io-rad/src/commonMain/kotlin/fluxo/io/util/IoUtil.kt index 77e77ee..e299931 100644 --- a/fluxo-io-rad/src/commonMain/kotlin/fluxo/io/util/Util.kt +++ b/fluxo-io-rad/src/commonMain/kotlin/fluxo/io/util/IoUtil.kt @@ -1,5 +1,4 @@ -@file:JvmName("Util") - +@file:JvmName("IoUtil") @file:Suppress("KDocUnresolvedReference") package fluxo.io.util @@ -19,6 +18,8 @@ public val EMPTY_BYTE_ARRAY: ByteArray = ByteArray(0) @JvmField public val EMPTY_AUTO_CLOSEABLE_ARRAY: Array = emptyArray() +internal const val MAX_BYTE: Int = 0xFF + /** * Helper method for bound check. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1f413f5..791bd5b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -27,6 +27,14 @@ kotlin = "2.0.20-Beta1" # https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core coroutines = "1.9.0-RC" +# https://github.com/square/okio/tags +# https://mvnrepository.com/artifact/com.squareup.okio/okio +okio = "3.9.0" + +# https://github.com/Kotlin/kotlinx-io/releases +# https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-io-core +kotlinx-io = "0.4.0" + # Android Plugin for Gradle. # Note: R8 version can be updated independently in settings.gradle.kts # https://maven.google.com/web/index.html#com.android.tools.build:gradle @@ -51,18 +59,12 @@ jmh = "1.37" [libraries] kotlin-stdlib-js = { module = "org.jetbrains.kotlin:kotlin-stdlib-js", version.ref = "kotlin" } -# https://github.com/Kotlin/kotlinx.coroutines/releases -# https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } -# https://github.com/square/okio/tags -# https://mvnrepository.com/artifact/com.squareup.okio/okio -okio = { module = "com.squareup.okio:okio", version = "3.9.0" } +okio = { module = "com.squareup.okio:okio", version.ref = "okio" } -# https://github.com/Kotlin/kotlinx-io/releases -# https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-io-core -kotlinx-io-core = { module = "org.jetbrains.kotlinx:kotlinx-io-core", version = "0.4.0" } -kotlinx-io-bytestring = { module = "org.jetbrains.kotlinx:kotlinx-io-bytestring", version = "0.4.0" } +kotlinx-io-core = { module = "org.jetbrains.kotlinx:kotlinx-io-core", version.ref = "kotlinx-io" } +kotlinx-io-bytestring = { module = "org.jetbrains.kotlinx:kotlinx-io-bytestring", version.ref = "kotlinx-io" } # https://developer.android.com/jetpack/androidx/releases/annotation # https://mvnrepository.com/artifact/androidx.annotation/annotation @@ -94,7 +96,7 @@ fluxo-bcv-js = { id = "io.github.fluxo-kt.binary-compatibility-validator-js", ve # Public API management tool # https://github.com/Kotlin/binary-compatibility-validator/releases -kotlinx-bcv = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.15.0-Beta.2" } +kotlinx-bcv = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.15.0-Beta.3" } # https://github.com/fluxo-kt/fluxo-kmp-conf/releases fluxo-kmp-conf = { id = "io.github.fluxo-kt.fluxo-kmp-conf", version = "0.11.0" }