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);
}