You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: formats/json/api/kotlinx-serialization-json.api
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,11 @@
1
+
public final class kotlinx/serialization/json/DecodeSequenceMode : java/lang/Enum {
2
+
public static final field ARRAY_WRAPPED Lkotlinx/serialization/json/DecodeSequenceMode;
3
+
public static final field AUTO_DETECT Lkotlinx/serialization/json/DecodeSequenceMode;
4
+
public static final field WHITESPACE_SEPARATED Lkotlinx/serialization/json/DecodeSequenceMode;
5
+
public static fun valueOf (Ljava/lang/String;)Lkotlinx/serialization/json/DecodeSequenceMode;
6
+
public static fun values ()[Lkotlinx/serialization/json/DecodeSequenceMode;
7
+
}
8
+
1
9
public abstract class kotlinx/serialization/json/Json : kotlinx/serialization/StringFormat {
2
10
public static final field Default Lkotlinx/serialization/json/Json$Default;
3
11
public synthetic fun <init> (Lkotlinx/serialization/json/JsonConfiguration;Lkotlinx/serialization/modules/SerializersModule;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
@@ -342,6 +350,8 @@ public abstract class kotlinx/serialization/json/JsonTransformingSerializer : ko
342
350
343
351
public final class kotlinx/serialization/json/JvmStreamsKt {
344
352
public static final fun decodeFromStream (Lkotlinx/serialization/json/Json;Lkotlinx/serialization/DeserializationStrategy;Ljava/io/InputStream;)Ljava/lang/Object;
353
+
public static final fun decodeToSequence (Lkotlinx/serialization/json/Json;Ljava/io/InputStream;Lkotlinx/serialization/DeserializationStrategy;Lkotlinx/serialization/json/DecodeSequenceMode;)Lkotlin/sequences/Sequence;
354
+
public static synthetic fun decodeToSequence$default (Lkotlinx/serialization/json/Json;Ljava/io/InputStream;Lkotlinx/serialization/DeserializationStrategy;Lkotlinx/serialization/json/DecodeSequenceMode;ILjava/lang/Object;)Lkotlin/sequences/Sequence;
345
355
public static final fun encodeToStream (Lkotlinx/serialization/json/Json;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;Ljava/io/OutputStream;)V
* Description of [decodeToSequence]'s JSON input shape.
86
+
*
87
+
* The sequence represents a stream of objects parsed one by one;
88
+
* [DecodeSequenceMode] defines a separator between these objects.
89
+
* Typically, these objects are not separated by meaningful characters ([WHITESPACE_SEPARATED]),
90
+
* or the whole stream is a large array of objects separated with commas ([ARRAY_WRAPPED]).
91
+
*/
92
+
@ExperimentalSerializationApi
93
+
publicenumclassDecodeSequenceMode {
94
+
/**
95
+
* Declares that objects in the input stream are separated by whitespace characters.
96
+
*
97
+
* The stream is read as multiple JSON objects separated by any number of whitespace characters between objects. Starting and trailing whitespace characters are also permitted.
98
+
* Each individual object is parsed lazily, when it is requested from the resulting sequence.
99
+
*
100
+
* Whitespace character is either ' ', '\n', '\r' or '\t'.
101
+
*
102
+
* Example of `WHITESPACE_SEPARATED` stream content:
val iter =JsonIterator(format, this, lexer, deserializer)
161
+
returnSequence { iter }.constrainOnce()
162
+
}
163
+
164
+
/**
165
+
* Transforms the given [stream] into lazily deserialized sequence of elements of type [T] using UTF-8 encoding and deserializer retrieved from the reified type parameter.
166
+
* Unlike [decodeFromStream], [stream] is allowed to have more than one element, separated as [format] declares.
167
+
*
168
+
* Elements must all be of type [T].
169
+
* Elements are parsed lazily when resulting [Sequence] is evaluated.
170
+
* Resulting sequence is tied to the stream and constrained to be evaluated only once.
171
+
*
172
+
* **Resource caution:** this method does not close [stream] when the parsing is finished neither provides method to close it manually.
173
+
* It is a caller responsibility to hold a reference to a stream and close it. Moreover, because stream is parsed lazily,
174
+
* closing it before returned sequence is evaluated fully would result in [IOException] from decoder.
175
+
*
176
+
* @throws [SerializationException] if the given JSON input cannot be deserialized to the value of type [T].
177
+
* @throws [IOException] If an I/O error occurs and stream can't be read from.
0 commit comments