public interface BufferAllocator
Buffers.| Modifier and Type | Method and Description |
|---|---|
Buffer |
fromAscii(CharSequence data)
Create a new
Buffer from the given CharSequence using Ascii encoding. |
Buffer |
fromAscii(CharSequence data,
boolean direct)
Create a new
Buffer from the given CharSequence using Ascii encoding. |
Buffer |
fromSequence(CharSequence data,
Charset charset)
|
Buffer |
fromSequence(CharSequence data,
Charset charset,
boolean direct)
|
Buffer |
fromUtf8(CharSequence data)
Create a new
Buffer from the given CharSequence using UTF-8 encoding. |
Buffer |
fromUtf8(CharSequence data,
boolean direct)
Create a new
Buffer from the given CharSequence using UTF-8 encoding. |
default Buffer |
newBuffer()
Create a new buffer.
|
default Buffer |
newBuffer(boolean direct)
Create a new buffer.
|
Buffer |
newBuffer(int initialCapacity)
Create a new buffer with the given initial capacity.
|
Buffer |
newBuffer(int initialCapacity,
boolean direct)
Create a new buffer with the given initial capacity.
|
CompositeBuffer |
newCompositeBuffer()
Create a new composite buffer.
|
CompositeBuffer |
newCompositeBuffer(int maxComponents)
Create a new composite buffer.
|
Buffer |
wrap(byte[] bytes)
Create a new
Buffer that wraps the given byte array. |
default Buffer |
wrap(byte[] bytes,
int offset,
int len)
Create a new
Buffer that wraps the given byte array. |
Buffer |
wrap(ByteBuffer buffer)
Create a new
Buffer that wraps the given ByteBuffer. |
default Buffer newBuffer()
default Buffer newBuffer(boolean direct)
direct - true if the buffer will be direct (off-heap), false otherwise.Buffer newBuffer(int initialCapacity)
initialCapacity - the initial capacity of the buffer.Buffer newBuffer(int initialCapacity, boolean direct)
initialCapacity - the initial capacity of the allocated buffer.direct - true if the buffer will be direct (off-heap), false otherwise.CompositeBuffer newCompositeBuffer()
CompositeBuffer newCompositeBuffer(int maxComponents)
maxComponents - The maximum number of top level Buffer objects that can be contained.Buffer fromSequence(CharSequence data, Charset charset)
data - the sequence.charset - the charset to use.Buffer fromSequence(CharSequence data, Charset charset, boolean direct)
data - the sequence.charset - the charset to use.direct - true if the buffer will be direct (off-heap), false otherwise.Buffer fromUtf8(CharSequence data)
Buffer from the given CharSequence using UTF-8 encoding.data - the sequence.Buffer fromUtf8(CharSequence data, boolean direct)
Buffer from the given CharSequence using UTF-8 encoding.data - the sequence.direct - true if the buffer will be direct (off-heap), false otherwise.Buffer fromAscii(CharSequence data)
Buffer from the given CharSequence using Ascii encoding.data - the sequence.Buffer fromAscii(CharSequence data, boolean direct)
Buffer from the given CharSequence using Ascii encoding.data - the sequence.direct - true if the buffer will be direct (off-heap), false otherwise.Buffer wrap(byte[] bytes)
Buffer that wraps the given byte array.bytes - the byte array.default Buffer wrap(byte[] bytes, int offset, int len)
Buffer that wraps the given byte array.bytes - the byte array.offset - the offset index of the array.len - the numbers of bytes.