startChunkedConversion 方法

ByteConversionSink startChunkedConversion(
  1. Sink<String> sink
)

开始分块转换。

如果给定的 sinkStringConversionSink,则转换器将更高效。

实现

ByteConversionSink startChunkedConversion(Sink<String> sink) {
  StringConversionSink stringSink;
  if (sink is StringConversionSink) {
    stringSink = sink;
  } else {
    stringSink = StringConversionSink.from(sink);
  }
  // TODO(lrn): Use stringSink.asUtf16Sink() if it becomes available.
  if (!_allowInvalid) return _Latin1DecoderSink(stringSink);
  return _Latin1AllowInvalidDecoderSink(stringSink);
}