startChunkedConversion 方法
启动分块转换。
如果给定的 sink
是一个 StringConversionSink,则转换器将更加高效。
实现
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);
}