Open
Description
Please see ByteConversionSink.addSlice() documentation https://api.dartlang.org/stable/1.22.1/dart-convert/ByteConversionSink/addSlice.html
Contrary to add the given chunk must not be held onto. Once the method returns, it is safe to overwrite the data in it.
The above means that it is unsafe to overwrite the data if add() is used instead of addSlice(). But I can't see that
import "dart:convert";
main() {
var outSink = new ChunkedConversionSink.withCallback((accumulated) {
print(accumulated);
});
ByteConversionSink inSink = UTF8.decoder.startChunkedConversion(outSink);
var list = UTF8.encode("Кириллица");
inSink.add(list);
// Now change the data, lowercase the first letter to к
list[0] = 0xd0;
list[1] = 0xba;
inSink.add(list);
inSink.close(); // prints [Кириллица, кириллица]
}
Seems that all is safe