decodeUtf16beAsIterable function

IterableUtf16Decoder decodeUtf16beAsIterable(
  1. List<int> bytes, [
  2. int offset = 0,
  3. int? length,
  4. bool stripBom = true,
  5. int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT,
])

Decodes the UTF-16BE bytes as an iterable. Thus, the consumer can only convert as much of the input as needed. This method strips a leading BOM by default, but can be overridden by setting the optional parameter stripBom to false. Set the replacementCodepoint to null to throw an ArgumentError rather than replace the bad value. The default value for the replacementCodepoint is U+FFFD.

Implementation

IterableUtf16Decoder decodeUtf16beAsIterable(List<int> bytes,
    [int offset = 0,
    int? length,
    bool stripBom = true,
    int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
  return IterableUtf16Decoder._(
      () => Utf16beBytesToCodeUnitsDecoder(
          bytes, offset, length, stripBom, replacementCodepoint),
      replacementCodepoint);
}