write method

Uint8List write()

Implementation

Uint8List write() {
  if (val.length != byteslen) {
    throw Exception('Buffer length is not appropriate');
  }

  // Convert the hexadecimal string back to a Uint8List
  Uint8List buffer =
      Uint8List.fromList(List<int>.generate(val.length, (i) => val[i]));

  return buffer;
}