convert method

  1. @override
String convert(
  1. List<int> input, [
  2. int start = 0,
  3. int? end,
  4. int replacementCodepoint = unicodeReplacementCharacterCodepoint,
])
override

Produce a String from a sequence of UTF-16 encoded bytes. 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 the replacementCodepoint is U+FFFD.

Implementation

@override
String convert(
  List<int> input, [
  int start = 0,
  int? end,
  int replacementCodepoint = unicodeReplacementCharacterCodepoint,
]) {
  var codeunits = (Utf16BytesToCodeUnitsDecoder(input, start,
          end == null ? input.length : end - start, replacementCodepoint))
      .decodeRest();
  return String.fromCharCodes(
      utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint)
          .whereType<int>());
}