Dart API Referencedart:utfUtf16beBytesToCodeUnitsDecoder

Utf16beBytesToCodeUnitsDecoder Class

Convert UTF-16BE encoded bytes to utf16 code units by grouping 1-2 bytes to produce the code unit (0-(2^16)-1).

Extends

Utf16BytesToCodeUnitsDecoder > Utf16beBytesToCodeUnitsDecoder

Constructors

Code new Utf16beBytesToCodeUnitsDecoder(List<int> utf16EncodedBytes, [int offset = 0, int length, bool stripBom = true, int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) #

Utf16beBytesToCodeUnitsDecoder(List<int> utf16EncodedBytes, [
    int offset = 0, int length, bool stripBom = true,
    int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) :
    super._fromListRangeIterator((new _ListRange(utf16EncodedBytes, offset,
    length)).iterator(), replacementCodepoint) {
  if (stripBom && hasUtf16beBom(utf16EncodedBytes, offset, length)) {
    skip();
  }
}

Methods

Code int decode() #

int decode() {
  int hi = utf16EncodedBytesIterator.next();
  int lo = utf16EncodedBytesIterator.next();
  return (hi << 8) + lo;
}