wrap static method
Wraps a byte array into a buffer.
The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa.
Implementation
static JByteBuffer wrap(
JArray<jbyte> array, [
int? offset,
int? length,
]) {
if (offset == null && length == null) {
return _wrapWholeId(
_class,
const JByteBufferType(),
[array.reference.pointer],
);
}
offset ??= 0;
length ??= array.length - offset;
return _wrapId(
_class,
const JByteBufferType(),
[array.reference.pointer, JValueInt(offset), JValueInt(length)],
);
}