Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions library/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ fun main() {
// Write UTF-8 encoded bytes to a FileStream (kmp-file:file)
val file = "/path/to/file.txt".toFile()
file.openWrite(excl = null).use { stream ->
decoded.decodeBuffered(UTF8, action = stream::write)
decoded.decodeBuffered(
decoder = UTF8,
throwOnOverflow = false,
action = stream::write,
)
}

// Now do it asynchronously (kmp-file:async)
Expand All @@ -67,8 +71,9 @@ fun main() {
file.openAppendAsync(excl = OpenExcl.MustExist)
.useAsync { stream ->
decoded.decodeBufferedAsync(
maxBufSize = 1024,
decoder = UTF8.ThrowOnInvalid,
throwOnOverflow = false,
maxBufSize = 1024,
action = stream::writeAsync,
)
}
Expand Down
19 changes: 19 additions & 0 deletions library/core/api/core.api
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
public abstract class io/matthewnelson/encoding/core/Decoder {
public static final field Companion Lio/matthewnelson/encoding/core/Decoder$Companion;
public synthetic fun <init> (Lio/matthewnelson/encoding/core/EncoderDecoder$Config;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public static final fun decodeBuffered (Ljava/lang/CharSequence;ILio/matthewnelson/encoding/core/Decoder;Lkotlin/jvm/functions/Function3;)J
public static final fun decodeBuffered (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;Lkotlin/jvm/functions/Function3;)J
public static final fun decodeBuffered (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;ZILkotlin/jvm/functions/Function3;)J
public static final fun decodeBuffered (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;ZLkotlin/jvm/functions/Function3;)J
public static final fun decodeBuffered (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;Z[BLkotlin/jvm/functions/Function3;)J
public static final fun decodeBuffered ([CLio/matthewnelson/encoding/core/Decoder;ZILkotlin/jvm/functions/Function3;)J
public static final fun decodeBuffered ([CLio/matthewnelson/encoding/core/Decoder;ZLkotlin/jvm/functions/Function3;)J
public static final fun decodeBuffered ([CLio/matthewnelson/encoding/core/Decoder;Z[BLkotlin/jvm/functions/Function3;)J
public static final fun decodeBufferedAsync (Ljava/lang/CharSequence;ILio/matthewnelson/encoding/core/Decoder;Lkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun decodeBufferedAsync (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;Lkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun decodeBufferedAsync (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;ZILkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun decodeBufferedAsync (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;ZLkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand All @@ -27,13 +29,15 @@ public abstract class io/matthewnelson/encoding/core/Decoder {
}

public final class io/matthewnelson/encoding/core/Decoder$Companion {
public final fun decodeBuffered (Ljava/lang/CharSequence;ILio/matthewnelson/encoding/core/Decoder;Lkotlin/jvm/functions/Function3;)J
public final fun decodeBuffered (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;Lkotlin/jvm/functions/Function3;)J
public final fun decodeBuffered (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;ZILkotlin/jvm/functions/Function3;)J
public final fun decodeBuffered (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;ZLkotlin/jvm/functions/Function3;)J
public final fun decodeBuffered (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;Z[BLkotlin/jvm/functions/Function3;)J
public final fun decodeBuffered ([CLio/matthewnelson/encoding/core/Decoder;ZILkotlin/jvm/functions/Function3;)J
public final fun decodeBuffered ([CLio/matthewnelson/encoding/core/Decoder;ZLkotlin/jvm/functions/Function3;)J
public final fun decodeBuffered ([CLio/matthewnelson/encoding/core/Decoder;Z[BLkotlin/jvm/functions/Function3;)J
public final fun decodeBufferedAsync (Ljava/lang/CharSequence;ILio/matthewnelson/encoding/core/Decoder;Lkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun decodeBufferedAsync (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;Lkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun decodeBufferedAsync (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;ZILkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun decodeBufferedAsync (Ljava/lang/CharSequence;Lio/matthewnelson/encoding/core/Decoder;ZLkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand Down Expand Up @@ -73,6 +77,12 @@ public final class io/matthewnelson/encoding/core/Decoder$OutFeed$Companion {
public abstract class io/matthewnelson/encoding/core/Encoder : io/matthewnelson/encoding/core/Decoder {
public static final field Companion Lio/matthewnelson/encoding/core/Encoder$Companion;
public synthetic fun <init> (Lio/matthewnelson/encoding/core/EncoderDecoder$Config;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public static final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZILkotlin/jvm/functions/Function3;)J
public static final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZLkotlin/jvm/functions/Function3;)J
public static final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;Z[CLkotlin/jvm/functions/Function3;)J
public static final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZILkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZLkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;Z[CLkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun encodeToByteArray ([BLio/matthewnelson/encoding/core/Encoder;)[B
public static final fun encodeToCharArray ([BLio/matthewnelson/encoding/core/Encoder;)[C
public static final fun encodeToString ([BLio/matthewnelson/encoding/core/Encoder;)Ljava/lang/String;
Expand All @@ -81,6 +91,12 @@ public abstract class io/matthewnelson/encoding/core/Encoder : io/matthewnelson/
}

public final class io/matthewnelson/encoding/core/Encoder$Companion {
public final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZILkotlin/jvm/functions/Function3;)J
public final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZLkotlin/jvm/functions/Function3;)J
public final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;Z[CLkotlin/jvm/functions/Function3;)J
public final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZILkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZLkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;Z[CLkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun encodeToByteArray ([BLio/matthewnelson/encoding/core/Encoder;)[B
public final fun encodeToCharArray ([BLio/matthewnelson/encoding/core/Encoder;)[C
public final fun encodeToString ([BLio/matthewnelson/encoding/core/Encoder;)Ljava/lang/String;
Expand Down Expand Up @@ -129,6 +145,7 @@ public abstract class io/matthewnelson/encoding/core/EncoderDecoder$Config {
public final field lineBreakResetOnFlush Z
public final field maxDecodeEmit I
public final field maxEncodeEmit I
public final field maxEncodeEmitWithLineBreak I
public final field paddingChar Ljava/lang/Character;
public fun <init> (Ljava/lang/Boolean;BLjava/lang/Character;)V
protected fun <init> (Ljava/lang/Boolean;BZLjava/lang/Character;IIZ)V
Expand All @@ -137,6 +154,8 @@ public abstract class io/matthewnelson/encoding/core/EncoderDecoder$Config {
public final fun decodeOutMaxSizeOrFail (Lio/matthewnelson/encoding/core/util/DecoderInput;)I
protected abstract fun decodeOutMaxSizeOrFailProtected (ILio/matthewnelson/encoding/core/util/DecoderInput;)I
protected abstract fun decodeOutMaxSizeProtected (J)J
public final fun encodeOutMaxSize (I)I
public final fun encodeOutMaxSize (IB)I
public final fun encodeOutMaxSize (J)J
public final fun encodeOutMaxSize (JB)J
public final fun encodeOutSize (J)J
Expand Down
Loading