JByteBuffer.allocate constructor

JByteBuffer.allocate(
  1. int capacity
)

Allocates a new byte buffer.

Throws:

  • IllegalArgumentException - If the capacity is a negative integer

Implementation

factory JByteBuffer.allocate(int capacity) {
  return _allocateId(_class, const JByteBufferType(), [JValueInt(capacity)]);
}