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

Start a chunked conversion.

Only one object can be passed into the returned sink.

The argument sink will receive byte lists in sizes depending on the bufferSize passed to the constructor when creating this encoder.

Source

ChunkedConversionSink<Object> startChunkedConversion(Sink<List<int>> sink) {
  ByteConversionSink byteSink;
  if (sink is ByteConversionSink) {
    byteSink = sink;
  } else {
    byteSink = new ByteConversionSink.from(sink);
  }
  return new _JsonUtf8EncoderSink(byteSink, _toEncodable,
                                  _indent, _bufferSize);
}