startChunkedConversion method Null safety

ChunkedConversionSink<Object?> startChunkedConversion(
  1. 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.


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