MCPcopy Create free account
hub / github.com/davidgiven/luje / allocate

Method allocate

lib/java/nio/ByteBuffer.java:48–53  ·  view source on GitHub ↗

Creates a byte buffer based on a newly allocated byte array. @param capacity the capacity of the new buffer @return the created byte buffer. @throws IllegalArgumentException if capacity < 0.

(int capacity)

Source from the content-addressed store, hash-verified

46 * if {@code capacity < 0}.
47 */
48 public static ByteBuffer allocate(int capacity) {
49 if (capacity < 0) {
50 throw new IllegalArgumentException();
51 }
52 return BufferFactory.newByteBuffer(capacity);
53 }
54
55 /**
56 * Creates a direct byte buffer based on a newly allocated memory block.

Callers 3

OutputStreamWriterClass · 0.95
encodeMethod · 0.95
allocateMoreMethod · 0.95

Calls 1

newByteBufferMethod · 0.95

Tested by

no test coverage detected