JByteBuffer.fromList constructor

JByteBuffer.fromList(
  1. Uint8List list
)

Creates a JByteBuffer from the content of list.

The JByteBuffer will be allocated using JByteBuffer.allocateDirect.

Implementation

factory JByteBuffer.fromList(Uint8List list) {
  final buffer = JByteBuffer.allocateDirect(list.length);
  buffer._asUint8ListUnsafe().setAll(0, list);
  return buffer;
}