|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ByteBufferAllocator
Interface defining interaction with ByteBuffer
| Method Summary | |
|---|---|
ByteBuffer |
allocate(int size)
Allocates and returns a ByteBuffer with Buffer.limit() set to the given size. |
void |
clear()
Clear all allocated ByteBuffer, resulting in a empty and ready to deserve ByteBufferAllocator |
void |
free(ByteBuffer buffer)
Returns the given ByteBuffer making it available for a future usage. |
int |
getCapacity()
|
int |
getNumber()
|
| Methods inherited from interface java.io.Closeable |
|---|
close |
| Method Detail |
|---|
void free(ByteBuffer buffer)
ByteBuffer making it available for a future usage. Returning twice a ByteBuffer won't throw an exception.
buffer - : the ByteBuffer to returnByteBuffer allocate(int size)
ByteBuffer with Buffer.limit() set to the given size.
When the allocation fails, it returns either null or throws an BufferOverflowException, depending on the implementation.
size - : the size in byte to allocate
ByteBuffer of the given size, or either return null or throw an BufferOverflowException when the allocation fails.void clear()
ByteBuffer, resulting in a empty and ready to deserve ByteBufferAllocator
int getCapacity()
int getNumber()
ByteBufferAllocator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||