decodeUtf16AsIterable function
Decodes the UTF-16 bytes as an iterable. Thus, the consumer can only convert
as much of the input as needed. Determines the byte order from the BOM,
or uses big-endian as a default. This method always strips a leading BOM.
Set the replacementCodepoint
to null to throw an ArgumentError
rather than replace the bad value. The default value for
replacementCodepoint
is U+FFFD.
Implementation
IterableUtf16Decoder decodeUtf16AsIterable(List<int> bytes,
[int offset = 0,
int? length,
int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
return IterableUtf16Decoder._(
() => Utf16BytesToCodeUnitsDecoder(
bytes, offset, length, replacementCodepoint),
replacementCodepoint);
}