decode method
Implementation
@override
String decode(List<int> utf16EncodedBytes, [int offset = 0, int? length]) {
if (Utf16Decoder.hasUtf16beBom(utf16EncodedBytes, offset, length)) {
offset = offset + 2;
}
length ??= utf16EncodedBytes.length - offset;
var sublist = utf16EncodedBytes.sublist(offset, offset + length);
sublist = _switchCharacters(sublist);
var utf16CodeUnits = Uint8List.fromList(sublist).buffer.asUint16List();
return String.fromCharCodes(utf16CodeUnits);
}