Skip to content

Commit bb16ab0

Browse files
authored
Implement partial array encoding (#233)
1 parent 40dcef0 commit bb16ab0

File tree

10 files changed

+861
-95
lines changed

10 files changed

+861
-95
lines changed

library/core/api/core.api

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,45 @@ public final class io/matthewnelson/encoding/core/Decoder$OutFeed$Companion {
7777
public abstract class io/matthewnelson/encoding/core/Encoder : io/matthewnelson/encoding/core/Decoder {
7878
public static final field Companion Lio/matthewnelson/encoding/core/Encoder$Companion;
7979
public synthetic fun <init> (Lio/matthewnelson/encoding/core/EncoderDecoder$Config;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
80+
public static final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZIIILkotlin/jvm/functions/Function3;)J
81+
public static final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZIILkotlin/jvm/functions/Function3;)J
82+
public static final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZII[CLkotlin/jvm/functions/Function3;)J
8083
public static final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZILkotlin/jvm/functions/Function3;)J
8184
public static final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZLkotlin/jvm/functions/Function3;)J
8285
public static final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;Z[CLkotlin/jvm/functions/Function3;)J
86+
public static final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZIIILkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
87+
public static final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZIILkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
88+
public static final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZII[CLkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
8389
public static final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZILkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
8490
public static final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZLkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
8591
public static final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;Z[CLkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
8692
public static final fun encodeToByteArray ([BLio/matthewnelson/encoding/core/Encoder;)[B
8793
public static final fun encodeToCharArray ([BLio/matthewnelson/encoding/core/Encoder;)[C
94+
public static final fun encodeToCharArray ([BLio/matthewnelson/encoding/core/Encoder;II)[C
8895
public static final fun encodeToString ([BLio/matthewnelson/encoding/core/Encoder;)Ljava/lang/String;
96+
public static final fun encodeToString ([BLio/matthewnelson/encoding/core/Encoder;II)Ljava/lang/String;
8997
public final fun newEncoderFeed (Lio/matthewnelson/encoding/core/Encoder$OutFeed;)Lio/matthewnelson/encoding/core/Encoder$Feed;
9098
protected abstract fun newEncoderFeedProtected (Lio/matthewnelson/encoding/core/Encoder$OutFeed;)Lio/matthewnelson/encoding/core/Encoder$Feed;
9199
}
92100

93101
public final class io/matthewnelson/encoding/core/Encoder$Companion {
102+
public final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZIIILkotlin/jvm/functions/Function3;)J
103+
public final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZIILkotlin/jvm/functions/Function3;)J
104+
public final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZII[CLkotlin/jvm/functions/Function3;)J
94105
public final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZILkotlin/jvm/functions/Function3;)J
95106
public final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;ZLkotlin/jvm/functions/Function3;)J
96107
public final fun encodeBuffered ([BLio/matthewnelson/encoding/core/Encoder;Z[CLkotlin/jvm/functions/Function3;)J
108+
public final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZIIILkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
109+
public final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZIILkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
110+
public final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZII[CLkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
97111
public final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZILkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
98112
public final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;ZLkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
99113
public final fun encodeBufferedAsync ([BLio/matthewnelson/encoding/core/Encoder;Z[CLkotlin/jvm/functions/Function4;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
100114
public final fun encodeToByteArray ([BLio/matthewnelson/encoding/core/Encoder;)[B
101115
public final fun encodeToCharArray ([BLio/matthewnelson/encoding/core/Encoder;)[C
116+
public final fun encodeToCharArray ([BLio/matthewnelson/encoding/core/Encoder;II)[C
102117
public final fun encodeToString ([BLio/matthewnelson/encoding/core/Encoder;)Ljava/lang/String;
118+
public final fun encodeToString ([BLio/matthewnelson/encoding/core/Encoder;II)Ljava/lang/String;
103119
}
104120

105121
public abstract class io/matthewnelson/encoding/core/Encoder$Feed : io/matthewnelson/encoding/core/EncoderDecoder$Feed {

library/core/api/core.klib.api

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,20 @@ sealed class <#A: io.matthewnelson.encoding.core/EncoderDecoder.Config> io.matth
276276
final object Companion { // io.matthewnelson.encoding.core/Encoder.Companion|null[0]
277277
final fun (kotlin/ByteArray).encodeBuffered(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Boolean, kotlin/CharArray, kotlin/Function3<kotlin/CharArray, kotlin/Int, kotlin/Int, kotlin/Unit>): kotlin/Long // io.matthewnelson.encoding.core/Encoder.Companion.encodeBuffered|encodeBuffered@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Boolean;kotlin.CharArray;kotlin.Function3<kotlin.CharArray,kotlin.Int,kotlin.Int,kotlin.Unit>){}[0]
278278
final fun (kotlin/ByteArray).encodeBuffered(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Boolean, kotlin/Int, kotlin/Function3<kotlin/CharArray, kotlin/Int, kotlin/Int, kotlin/Unit>): kotlin/Long // io.matthewnelson.encoding.core/Encoder.Companion.encodeBuffered|encodeBuffered@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Boolean;kotlin.Int;kotlin.Function3<kotlin.CharArray,kotlin.Int,kotlin.Int,kotlin.Unit>){}[0]
279+
final fun (kotlin/ByteArray).encodeBuffered(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Boolean, kotlin/Int, kotlin/Int, kotlin/CharArray, kotlin/Function3<kotlin/CharArray, kotlin/Int, kotlin/Int, kotlin/Unit>): kotlin/Long // io.matthewnelson.encoding.core/Encoder.Companion.encodeBuffered|encodeBuffered@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Boolean;kotlin.Int;kotlin.Int;kotlin.CharArray;kotlin.Function3<kotlin.CharArray,kotlin.Int,kotlin.Int,kotlin.Unit>){}[0]
280+
final fun (kotlin/ByteArray).encodeBuffered(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Boolean, kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Function3<kotlin/CharArray, kotlin/Int, kotlin/Int, kotlin/Unit>): kotlin/Long // io.matthewnelson.encoding.core/Encoder.Companion.encodeBuffered|encodeBuffered@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Boolean;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Function3<kotlin.CharArray,kotlin.Int,kotlin.Int,kotlin.Unit>){}[0]
279281
final fun (kotlin/ByteArray).encodeToByteArray(io.matthewnelson.encoding.core/Encoder<*>): kotlin/ByteArray // io.matthewnelson.encoding.core/Encoder.Companion.encodeToByteArray|encodeToByteArray@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>){}[0]
280282
final fun (kotlin/ByteArray).encodeToCharArray(io.matthewnelson.encoding.core/Encoder<*>): kotlin/CharArray // io.matthewnelson.encoding.core/Encoder.Companion.encodeToCharArray|encodeToCharArray@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>){}[0]
283+
final fun (kotlin/ByteArray).encodeToCharArray(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Int, kotlin/Int): kotlin/CharArray // io.matthewnelson.encoding.core/Encoder.Companion.encodeToCharArray|encodeToCharArray@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Int;kotlin.Int){}[0]
281284
final fun (kotlin/ByteArray).encodeToString(io.matthewnelson.encoding.core/Encoder<*>): kotlin/String // io.matthewnelson.encoding.core/Encoder.Companion.encodeToString|encodeToString@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>){}[0]
285+
final fun (kotlin/ByteArray).encodeToString(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Int, kotlin/Int): kotlin/String // io.matthewnelson.encoding.core/Encoder.Companion.encodeToString|encodeToString@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Int;kotlin.Int){}[0]
286+
final inline fun (kotlin/ByteArray).encodeBuffered(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Boolean, kotlin/Int, kotlin/Int, noinline kotlin/Function3<kotlin/CharArray, kotlin/Int, kotlin/Int, kotlin/Unit>): kotlin/Long // io.matthewnelson.encoding.core/Encoder.Companion.encodeBuffered|encodeBuffered@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Boolean;kotlin.Int;kotlin.Int;kotlin.Function3<kotlin.CharArray,kotlin.Int,kotlin.Int,kotlin.Unit>){}[0]
282287
final inline fun (kotlin/ByteArray).encodeBuffered(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Boolean, noinline kotlin/Function3<kotlin/CharArray, kotlin/Int, kotlin/Int, kotlin/Unit>): kotlin/Long // io.matthewnelson.encoding.core/Encoder.Companion.encodeBuffered|encodeBuffered@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Boolean;kotlin.Function3<kotlin.CharArray,kotlin.Int,kotlin.Int,kotlin.Unit>){}[0]
283288
final suspend fun (kotlin/ByteArray).encodeBufferedAsync(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Boolean, kotlin/CharArray, kotlin.coroutines/SuspendFunction3<kotlin/CharArray, kotlin/Int, kotlin/Int, kotlin/Unit>): kotlin/Long // io.matthewnelson.encoding.core/Encoder.Companion.encodeBufferedAsync|encodeBufferedAsync@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Boolean;kotlin.CharArray;kotlin.coroutines.SuspendFunction3<kotlin.CharArray,kotlin.Int,kotlin.Int,kotlin.Unit>){}[0]
284289
final suspend fun (kotlin/ByteArray).encodeBufferedAsync(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Boolean, kotlin/Int, kotlin.coroutines/SuspendFunction3<kotlin/CharArray, kotlin/Int, kotlin/Int, kotlin/Unit>): kotlin/Long // io.matthewnelson.encoding.core/Encoder.Companion.encodeBufferedAsync|encodeBufferedAsync@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Boolean;kotlin.Int;kotlin.coroutines.SuspendFunction3<kotlin.CharArray,kotlin.Int,kotlin.Int,kotlin.Unit>){}[0]
290+
final suspend fun (kotlin/ByteArray).encodeBufferedAsync(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Boolean, kotlin/Int, kotlin/Int, kotlin/CharArray, kotlin.coroutines/SuspendFunction3<kotlin/CharArray, kotlin/Int, kotlin/Int, kotlin/Unit>): kotlin/Long // io.matthewnelson.encoding.core/Encoder.Companion.encodeBufferedAsync|encodeBufferedAsync@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Boolean;kotlin.Int;kotlin.Int;kotlin.CharArray;kotlin.coroutines.SuspendFunction3<kotlin.CharArray,kotlin.Int,kotlin.Int,kotlin.Unit>){}[0]
291+
final suspend fun (kotlin/ByteArray).encodeBufferedAsync(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Boolean, kotlin/Int, kotlin/Int, kotlin/Int, kotlin.coroutines/SuspendFunction3<kotlin/CharArray, kotlin/Int, kotlin/Int, kotlin/Unit>): kotlin/Long // io.matthewnelson.encoding.core/Encoder.Companion.encodeBufferedAsync|encodeBufferedAsync@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Boolean;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.coroutines.SuspendFunction3<kotlin.CharArray,kotlin.Int,kotlin.Int,kotlin.Unit>){}[0]
292+
final suspend inline fun (kotlin/ByteArray).encodeBufferedAsync(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Boolean, kotlin/Int, kotlin/Int, noinline kotlin.coroutines/SuspendFunction3<kotlin/CharArray, kotlin/Int, kotlin/Int, kotlin/Unit>): kotlin/Long // io.matthewnelson.encoding.core/Encoder.Companion.encodeBufferedAsync|encodeBufferedAsync@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Boolean;kotlin.Int;kotlin.Int;kotlin.coroutines.SuspendFunction3<kotlin.CharArray,kotlin.Int,kotlin.Int,kotlin.Unit>){}[0]
285293
final suspend inline fun (kotlin/ByteArray).encodeBufferedAsync(io.matthewnelson.encoding.core/Encoder<*>, kotlin/Boolean, noinline kotlin.coroutines/SuspendFunction3<kotlin/CharArray, kotlin/Int, kotlin/Int, kotlin/Unit>): kotlin/Long // io.matthewnelson.encoding.core/Encoder.Companion.encodeBufferedAsync|encodeBufferedAsync@kotlin.ByteArray(io.matthewnelson.encoding.core.Encoder<*>;kotlin.Boolean;kotlin.coroutines.SuspendFunction3<kotlin.CharArray,kotlin.Int,kotlin.Int,kotlin.Unit>){}[0]
286294
}
287295
}

0 commit comments

Comments
 (0)