read method

List read()

Implementation

List<dynamic> read() {
  if (val.length < byteslen) {
    throw Exception('Not enough bytes!');
  }

  // Convert the byte buffer to a hexadecimal string
  String hexString =
      val.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join();

  // Return the hex string and the remaining buffer
  return [hexString, val.sublist(byteslen)];
}