what is the equivalent of ByteBuffer.wrap in dart?

Viewed 401

I have the following snippet of code to be converted to dart.

JAVA CODE

static final byte[] MESSAGE_M1_REQUEST = new byte[]{(int) 1, (int) 2, (int) 3, (int) 4};
ByteBuffer bf =   ByteBuffer.wrap(MESSAGE_M1_REQUEST);
int certLength = ByteBuffer.wrap(macIdBytes).getInt();

Dart

Using Uint8List in Dart instead of byte[] and how to do ByteBuffer.wrap & use .getInt() on Uint8List ?

final Uint8List MESSAGE_M1_REQUEST = Uint8List.fromList([1, 2, 3, 4]);
1 Answers
Related