Spec-Zone.ru › Dart 1

dart:convert

Метод convert

String convert(List<int> bytes, [ int start = 0, int end ])

Преобразует bytes (список беззнаковых 7- или 8-битовых целых чисел) в соответствующую строку.

Если start и end заданы, используется только подсписок байтов от start до end (end не включительно) в качестве входных данных для преобразования.

Исходный код

String convert(List<int> bytes, [int start = 0, int end]) {
  int byteCount = bytes.length;
  RangeError.checkValidRange(start, end, byteCount);
  if (end == null) end = byteCount;

  for (int i = start; i < end; i++) {
    int byte = bytes[i];
    if ((byte & ~_subsetMask) != 0) {
      if (!_allowInvalid) {
        throw new FormatException("Invalid value in input: $byte");
      }
      return _convertInvalid(bytes, start, end);
    }
  }
  return new String.fromCharCodes(bytes, start, end);
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-convert/AsciiDecoder/convert.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API