Creates a new array-backed buffer containing data copied from a chunk.
Creates a new array-backed buffer containing data copied from a chunk.
The new buffer will have a capacity equal to the chunk length, its position will be 0 and its limit set to the capacity.
The data to copy into the new buffer.
Allocates a byte buffer backed by a new array.
Allocates a byte buffer backed by a new array.
The new buffer's position will be 0, and its limit will be its capacity.
Dies with IllegalArgumentException
if capacity
is negative.
The number of bytes to allocate.
Allocates a direct byte buffer.
Allocates a direct byte buffer.
The new buffer's position will be 0, and its limit will be its capacity.
Dies with IllegalArgumentException
if capacity
is negative.
The number of bytes to allocate.
Wraps an existing Java ByteBuffer
.
Wraps an existing Java ByteBuffer
.
This is only useful for inter-operating with Java APIs that provide Java byte buffers.
Creates a read-only character buffer wrapping a character sequence.
Creates a read-only character buffer wrapping a character sequence.
The new buffer's capacity and limit will be charSequence.length
and its position will be 0.
The characters to wrap.
Creates a read-only character buffer wrapping a character sequence.
Creates a read-only character buffer wrapping a character sequence.
The new buffer's capacity will be charSequence.length
, its position will be start
and its limit will be end
.
Dies with IndexOutOfBoundsException
if start
or end
are out of bounds.
The characters to wrap.
must be >= 0 and <= capacity
must be >= start and <= capacity
Creates a new array-backed buffer containing data copied from a chunk.
Creates a new array-backed buffer containing data copied from a chunk.
The new buffer will have a capacity equal to the chunk length, its position will be 0 and its limit set to the capacity.
The data to copy into the new buffer.
Allocates a char buffer backed by a new array.
Allocates a char buffer backed by a new array.
The new buffer's position will be 0, and its limit will be its capacity.
Dies with IllegalArgumentException
if capacity
is negative.
The number of characters to allocate.
Wraps an existing Java CharBuffer
.
Wraps an existing Java CharBuffer
.
This is only useful for inter-operating with Java APIs that provide Java byte buffers.
Creates a new array-backed buffer containing data copied from a chunk.
Creates a new array-backed buffer containing data copied from a chunk.
The new buffer will have a capacity equal to the chunk length, its position will be 0 and its limit set to the capacity.
The data to copy into the new buffer.
Allocates an double buffer backed by a new array.
Allocates an double buffer backed by a new array.
The new buffer's position will be 0, and its limit will be its capacity.
Dies with IllegalArgumentException
if capacity
is negative.
The number of doubles to allocate.
Wraps an existing Java DoubleBuffer
.
Wraps an existing Java DoubleBuffer
.
This is only useful for inter-operating with Java APIs that provide Java byte buffers.
Creates a new array-backed buffer containing data copied from a chunk.
Creates a new array-backed buffer containing data copied from a chunk.
The new buffer will have a capacity equal to the chunk length, its position will be 0 and its limit set to the capacity.
The data to copy into the new buffer.
Allocates a float buffer backed by a new array.
Allocates a float buffer backed by a new array.
The new buffer's position will be 0, and its limit will be its capacity.
Dies with IllegalArgumentException
if capacity
is negative.
The number of floats to allocate.
Wraps an existing Java FloatBuffer
.
Wraps an existing Java FloatBuffer
.
This is only useful for inter-operating with Java APIs that provide Java byte buffers.
Creates a new array-backed buffer containing data copied from a chunk.
Creates a new array-backed buffer containing data copied from a chunk.
The new buffer will have a capacity equal to the chunk length, its position will be 0 and its limit set to the capacity.
The data to copy into the new buffer.
Allocates an int buffer backed by a new array.
Allocates an int buffer backed by a new array.
The new buffer's position will be 0, and its limit will be its capacity.
Dies with IllegalArgumentException
if capacity
is negative.
The number of ints to allocate.
Wraps an existing Java IntBuffer
.
Wraps an existing Java IntBuffer
.
This is only useful for inter-operating with Java APIs that provide Java byte buffers.
Creates a new array-backed buffer containing data copied from a chunk.
Creates a new array-backed buffer containing data copied from a chunk.
The new buffer will have a capacity equal to the chunk length, its position will be 0 and its limit set to the capacity.
The data to copy into the new buffer.
Allocates a long buffer backed by a new array.
Allocates a long buffer backed by a new array.
The new buffer's position will be 0, and its limit will be its capacity.
Dies with IllegalArgumentException
if capacity
is negative.
The number of longs to allocate.
Wraps an existing Java LongBuffer
.
Wraps an existing Java LongBuffer
.
This is only useful for inter-operating with Java APIs that provide Java byte buffers.
Creates a new array-backed buffer containing data copied from a chunk.
Creates a new array-backed buffer containing data copied from a chunk.
The new buffer will have a capacity equal to the chunk length, its position will be 0 and its limit set to the capacity.
The data to copy into the new buffer.
Allocates a short buffer backed by a new array.
Allocates a short buffer backed by a new array.
The new buffer's position will be 0, and its limit will be its capacity.
Dies with IllegalArgumentException
if capacity
is negative.
The number of shorts to allocate.
Wraps an existing Java ShortBuffer
.
Wraps an existing Java ShortBuffer
.
This is only useful for inter-operating with Java APIs that provide Java byte buffers.