readUtf8String method

String readUtf8String(
  1. List<int> byteList
)

Implementation

String readUtf8String(List<int> byteList) {
  int end = byteList.indexWhere((element) => element == 0x00);
  if (end == -1) end = byteList.length;
  return utf8.decode(byteList.sublist(0, end));
}