java.lang.Object
org.glassfish.grizzly.memory.CompositeBuffer
- All Implemented Interfaces:
Comparable<Buffer>,WritableMessage,Buffer
- Direct Known Subclasses:
BuffersBuffer
- Author:
- Alexey Stashok
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBulk Buffer operation, responsible for byte-by-byte Buffer processing.static enumThe order in which internalBuffers will be disposed.static interfaceSetter. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanabstract voidallowInternalBuffersDispose(boolean allow) abstract CompositeBufferabstract intbulk(CompositeBuffer.BulkOperation operation) Iterates overBufferbytes fromBuffer.position()toBuffer.limit()and letsCompositeBuffer.BulkOperationexamine/change the buffer content;abstract intbulk(CompositeBuffer.BulkOperation operation, int position, int limit) Iterates overBufferbytes from position to limit and letsCompositeBuffer.BulkOperationexamine/change the buffer content;Returns the order in which internalBuffers will be disposed.disposeOrder(CompositeBuffer.DisposeOrder disposeOrder) Sets the order in which internalBuffers will be disposed.static CompositeBufferConstruct CompositeBuffer.static CompositeBuffernewBuffer(MemoryManager memoryManager) static CompositeBuffernewBuffer(MemoryManager memoryManager, Buffer... buffers) static CompositeBuffernewBuffer(MemoryManager memoryManager, Buffer[] buffers, boolean isReadOnly) abstract CompositeBufferPrepend data from header.position() to header.limit() to the current buffer.abstract voidRemoves underlyingBuffers, without disposingabstract booleanReplace one internalBufferwith another one.abstract Object[]Return the underlying bufferMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.glassfish.grizzly.Buffer
allowBufferDispose, allowBufferDispose, array, arrayOffset, asReadOnlyBuffer, capacity, clear, compact, dispose, dumpHex, duplicate, flip, get, get, get, get, get, get, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, hasArray, hasRemaining, isComposite, isDirect, isReadOnly, limit, limit, mark, order, order, position, position, put, put, put, put, put, put, put, put, put8BitString, putChar, putChar, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putLong, putLong, putShort, putShort, remaining, reset, rewind, shrink, slice, slice, split, toBufferArray, toBufferArray, toBufferArray, toBufferArray, toByteBuffer, toByteBuffer, toByteBufferArray, toByteBufferArray, toByteBufferArray, toByteBufferArray, toStringContent, toStringContent, toStringContent, trim, tryDisposeMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.glassfish.grizzly.asyncqueue.WritableMessage
isExternal, release
-
Field Details
-
disposeOrder
-
-
Constructor Details
-
CompositeBuffer
public CompositeBuffer()
-
-
Method Details
-
newBuffer
Construct CompositeBuffer.- Returns:
- new CompositeBuffer
-
newBuffer
-
newBuffer
-
newBuffer
public static CompositeBuffer newBuffer(MemoryManager memoryManager, Buffer[] buffers, boolean isReadOnly) -
disposeOrder
Returns the order in which internalBuffers will be disposed.- Returns:
CompositeBuffer.DisposeOrder
-
disposeOrder
Sets the order in which internalBuffers will be disposed.- Parameters:
disposeOrder-- Returns:
- this buffer
-
append
-
prepend
Description copied from interface:BufferPrepend data from header.position() to header.limit() to the current buffer. This will change the value returned by buffer()! -
underlying
Description copied from interface:BufferReturn the underlying buffer- Specified by:
underlyingin interfaceBuffer- Returns:
- the underlying buffer
-
removeAll
public abstract void removeAll()Removes underlyingBuffers, without disposing -
allowInternalBuffersDispose
public abstract void allowInternalBuffersDispose(boolean allow) -
allowInternalBuffersDispose
public abstract boolean allowInternalBuffersDispose() -
bulk
Iterates overBufferbytes fromBuffer.position()toBuffer.limit()and letsCompositeBuffer.BulkOperationexamine/change the buffer content;- Parameters:
operation-CompositeBuffer.BulkOperation- Returns:
- Buffer position the processing was stopped on, or -1, if processing reached the limit.
-
bulk
Iterates overBufferbytes from position to limit and letsCompositeBuffer.BulkOperationexamine/change the buffer content;- Parameters:
operation-CompositeBuffer.BulkOperation- Returns:
- Buffer position the processing was stopped on, or -1, if processing reached the limit.
-
replace
Replace one internalBufferwith another one.
-