MemoryManager to create and modify Buffers
java.nio.Buffer , org.glassfish.grizzly.Buffer
| Modifier and Type | Method and Description |
|---|---|
| public E | Returns: the new buffermaximum number of elements size)Creates a buffer with a given capacity and limit |
| public boolean | Returns: true if there are unused elements, false otherwiseWhether there are elements between the current position and the end |
| public boolean | Returns: true if the end of the buffer has been allocated, false otherwisethe buffer to check oldBuffer)Whether the last element in the buffer has been set |
| public E | Returns: the new Buffer or null if the buffer could not be resizedOld Buffer containing data oldBuffer, int The size the new Buffer should be. 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. |
| public E | Returns: the old buffer data that was removed. This may be null.Reduces the buffer to the last data allocated |
| public boolean | Returns: true if operation successfully completed, false otherwisethe buffer to release underlyingBuffer)deallocates the data in the buffer |
| public int | Returns: number of elementsGets the number of elements between the current position and the limit |
| public void | |
| public boolean | Returns: true if the the buffer should be enlarged to hold the desired sizethe desired size of the buffer. If this is less than the current size ofthe buffer then this will return
false size)Checks if the size of the Buffer should be reset. |
| allocate | back to summary |
|---|---|
| public E allocate(int size) Creates a buffer with a given capacity and limit
| |
| hasRemaining | back to summary |
|---|---|
| public boolean hasRemaining() Whether there are elements between the current position and the end
| |
| isLastAllocated | back to summary |
|---|---|
| public boolean isLastAllocated(E oldBuffer) Whether the last element in the buffer has been set
| |
| reallocate | back to summary |
|---|---|
| public E reallocate(E oldBuffer, 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.
| |
| reduceLastAllocated | back to summary |
|---|---|
| public E reduceLastAllocated(E buffer) Reduces the buffer to the last data allocated
| |
| release | back to summary |
|---|---|
| public boolean release(E underlyingBuffer) deallocates the data in the buffer
| |
| remaining | back to summary |
|---|---|
| public int remaining() Gets the number of elements between the current position and the limit
| |
| reset | back to summary |
|---|---|
| public void reset(E pool) Resets the Buffer to empty values and empties the pool
| |
| wantReset | back to summary |
|---|---|
| public boolean wantReset(int size) Checks if the size of the Buffer should be reset.
| |