JsonStreamWriter class

Encodes JSON values to a stream asynchronously, this is useful for encoding extremely large objects that would consume too much memory with a standard JsonEncoder.

Constructors

JsonStreamWriter()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<List<int>>
latefinal

Methods

close() Future<void>
Closes the writer and waits for listeners of stream to finish.
end() Future<void>
Ends a map or list.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startList() Future<void>
Starts a JSON list, this is method should only be called when a value is expected.
startMap() Future<void>
Starts a JSON map, this is method should only be called when a value is expected.
toString() String
A string representation of this object.
inherited
write(Object? value) Future<void>
Encodes and writes an arbitrary JSON value, this is method should only be called when a value is expected.
writeEntry(String key, Object? value) Future<void>
Writes an entry to a map, this is equivalent to calling writeKey followed by write.
writeKey(String key) Future<void>
Writes a simple key string, this should only be called inside of a map and the following write needs to be a value.
writeKeyStream(Stream<String> stream) Future<void>
Writes a key from a stream of string parts, I feel bad for anyone that needs this.
writeRawBuffer(List<int> buffer) Future<void>
Writes a JSON value from a raw buffer of bytes, this buffer must contain a valid UTF-8 encoded json object.
writeRawStream(Stream<List<int>> stream) Future<void>
Writes a raw JSON value from a stream of bytes, this stream must contain a valid json encoded object.
writeRawString(String json) Future<void>
Writes a raw JSON value from a string, this string must contain a valid json encoded object.
writeStringStream(Stream<String> stream) Future<void>
Writes a string value from a stream of string parts.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

encode(Object? value) Stream<List<int>>
Converts a single value to a json stream.