T - Type of Buffer that will be created
Based on Grizzly Implementationpublic interface ByteBufferPool<T extends ByteBuffer>
ByteBufferProvider to create and modify Buffers| Modifier and Type | Method and Description |
|---|---|
T |
allocate(int size)
Creates a buffer with a given capacity and limit
|
void |
dispose()
dospose the thread local pool.
|
int |
getMaxBufferSize()
The Max Buffer Size for buffer
|
boolean |
hasRemaining()
Whether there are elements between the current position and the end
|
ByteBuffer |
reallocate(ByteBuffer oldByteBuffer,
int newSize)
Creates a new Buffer with a set size and assigns it the data that was held in the old one as long as the given size is not
smaller than the data held.
|
ByteBuffer |
reduceLastAllocated(ByteBuffer byteBuffer)
Reduces the buffer to the last data allocated
|
boolean |
release(ByteBuffer byteBuffer)
deallocates the data in the buffer
|
int |
remaining()
Gets the number of elements between the current position and the limit
|
void |
reset(T byteBuffer)
Resets the Buffer to empty values and empties the pool
|
ByteBuffer reallocate(ByteBuffer oldByteBuffer, int newSize)
oldByteBuffer - Old Buffer containing datanewSize - The size the new Buffer should be.boolean release(ByteBuffer byteBuffer)
byteBuffer - the buffer to releaseByteBuffer reduceLastAllocated(ByteBuffer byteBuffer)
byteBuffer - int remaining()
void reset(T byteBuffer)
byteBuffer - the buffer to resetT allocate(int size)
size - maximum number of elementsByteBuffer.allocate(int)boolean hasRemaining()
int getMaxBufferSize()
void dispose()
Copyright © 2003–2022 MuleSoft, Inc.. All rights reserved.