Encoder that encodes a single object as a UTF-8 encoded JSON string.

This encoder works equivalently to first converting the object to a JSON string, and then UTF-8 encoding the string, but without creating an intermediate string.

Inheritance

Constants

DEFAULT_BUFFER_SIZE int

Default buffer size used by the JSON-to-UTF-8 encoder.

const 256

Constructors

JsonUtf8Encoder([String indent, dynamic toEncodable(Object object), int bufferSize = DEFAULT_BUFFER_SIZE])

Create converter.

Properties

hashCode int

Get a hash code for this object.

read-only, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

bind(Stream<Object> stream) Stream<List<int>>

Transform the incoming stream's events.

convert(Object object) List<int>

Convert object into UTF-8 encoded JSON.

fuse(Converter<List<int>, dynamic> other) Converter<Object, dynamic>

Fuses this with other.

noSuchMethod(Invocation invocation) → dynamic

noSuchMethod is invoked when users invoke a non-existent method on an object. The name of the method and the arguments of the invocation are passed to noSuchMethod in an Invocation. If noSuchMethod returns a value, that value becomes the result of the original invocation.

inherited
startChunkedConversion(Sink<List<int>> sink) ChunkedConversionSink<Object>

Start a chunked conversion.

toString() String

Returns a string representation of this object.

inherited