/** * Creates a direct byte buffer based on a newly allocated memory block. * * @param capacity * the capacity of the new buffer * @return the created byte buffer. * @throws IllegalArgumentException * if {@code capacity < 0}. */ public static ByteBuffer allocateDirect(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("capacity < 0: " + capacity); } return new DirectByteBuffer(MemoryBlock.allocate(capacity), capacity, 0, false, null); }
/** * Creates a direct byte buffer based on a newly allocated memory block. * * @param capacity * the capacity of the new buffer * @return the created byte buffer. * @throws IllegalArgumentException * if {@code capacity < 0}. */ public static ByteBuffer allocateDirect(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("capacity < 0: " + capacity); } return new DirectByteBuffer(MemoryBlock.allocate(capacity), capacity, 0, false, null); }
/** * Creates a direct byte buffer based on a newly allocated memory block. * * @param capacity * the capacity of the new buffer * @return the created byte buffer. * @throws IllegalArgumentException * if {@code capacity < 0}. */ public static ByteBuffer allocateDirect(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("capacity < 0: " + capacity); } return new DirectByteBuffer(MemoryBlock.allocate(capacity), capacity, 0, false, null); }
/** * Creates a direct byte buffer based on a newly allocated memory block. * * @param capacity * the capacity of the new buffer * @return the created byte buffer. * @throws IllegalArgumentException * if {@code capacity < 0}. */ public static ByteBuffer allocateDirect(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("capacity < 0: " + capacity); } return new DirectByteBuffer(MemoryBlock.allocate(capacity), capacity, 0, false, null); }
/** * Creates a direct byte buffer based on a newly allocated memory block. * * @param capacity * the capacity of the new buffer * @return the created byte buffer. * @throws IllegalArgumentException * if {@code capacity < 0}. */ public static ByteBuffer allocateDirect(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("capacity < 0: " + capacity); } return new DirectByteBuffer(MemoryBlock.allocate(capacity), capacity, 0, false, null); }
/** * Creates a direct byte buffer based on a newly allocated memory block. * * @param capacity * the capacity of the new buffer * @return the created byte buffer. * @throws IllegalArgumentException * if {@code capacity < 0}. */ public static ByteBuffer allocateDirect(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("capacity < 0: " + capacity); } return new DirectByteBuffer(MemoryBlock.allocate(capacity), capacity, 0, false, null); }
/** * Creates a direct byte buffer based on a newly allocated memory block. * * @param capacity * the capacity of the new buffer * @return the created byte buffer. * @throws IllegalArgumentException * if {@code capacity < 0}. */ public static ByteBuffer allocateDirect(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("capacity < 0: " + capacity); } return new DirectByteBuffer(MemoryBlock.allocate(capacity), capacity, 0, false, null); }