Top Inners Fields Constructors Methods
org.glassfish.grizzly.memory

public abstract Class CompositeBuffer

extends Object
implements Buffer
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.Buffer, org.glassfish.grizzly.asyncqueue.WritableMessage, java.lang.Comparable
Known Direct Subclasses
org.glassfish.grizzly.memory.BuffersBuffer
Imports
org.glassfish.grizzly.Buffer

Author
Alexey Stashok

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
CompositeBuffer.BulkOperation

Bulk Buffer operation, responsible for byte-by-byte Buffer processing.

public static enum
CompositeBuffer.DisposeOrder

The order in which internal Buffers will be disposed.

public static interface

Field Summary

Modifier and TypeField and Description
protected CompositeBuffer.DisposeOrder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract void
public abstract boolean
public abstract CompositeBuffer
append(Buffer buffer)

public abstract int

Returns:

Buffer position the processing was stopped on, or -1, if processing reached the limit.
bulk
(CompositeBuffer.BulkOperation operation)

Iterates over Buffer bytes from position() to limit() and lets BulkOperation examine/change the buffer content;

public abstract int

Returns:

Buffer position the processing was stopped on, or -1, if processing reached the limit.
bulk
(CompositeBuffer.BulkOperation operation, int position, int limit)

Iterates over Buffer bytes from position to limit and lets BulkOperation examine/change the buffer content;

public CompositeBuffer.DisposeOrder

Returns:

DisposeOrder
disposeOrder
()

Returns the order in which internal Buffers will be disposed.

public CompositeBuffer

Returns:

this buffer
disposeOrder
(final CompositeBuffer.DisposeOrder disposeOrder)

Sets the order in which internal Buffers will be disposed.

public static CompositeBuffer

Returns:

new CompositeBuffer
newBuffer
()

Construct CompositeBuffer.

public static CompositeBuffer
newBuffer(final MemoryManager<E extends Buffer> memoryManager)

public static CompositeBuffer
newBuffer(final MemoryManager<E extends Buffer> memoryManager, final Buffer... buffers)

public static CompositeBuffer
newBuffer(final MemoryManager<E extends Buffer> memoryManager, final Buffer[] buffers, final boolean isReadOnly)

public abstract CompositeBuffer
prepend(Buffer buffer)

Redeclares org.glassfish.grizzly.Buffer.prepend.

Prepend data from header.position() to header.limit() to the current buffer.

public abstract void
removeAll()

Removes underlying Buffers, without disposing

public abstract boolean

Returns:

true, if the oldBuffer was found and replaced, or false otherwise.
replace
(Buffer
the Buffer to replace.
oldBuffer
,
Buffer
the new Buffer.
newBuffer
)

Replace one internal Buffer with another one.

public abstract Object[]
underlying()

Redeclares org.glassfish.grizzly.Buffer.underlying.

Return the underlying buffer

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

disposeOrderback to summary
protected CompositeBuffer.DisposeOrder disposeOrder

Constructor Detail

CompositeBufferback to summary
public CompositeBuffer()

Method Detail

allowInternalBuffersDisposeback to summary
public abstract void allowInternalBuffersDispose(boolean allow)
allowInternalBuffersDisposeback to summary
public abstract boolean allowInternalBuffersDispose()
appendback to summary
public abstract CompositeBuffer append(Buffer buffer)
bulkback to summary
public abstract int bulk(CompositeBuffer.BulkOperation operation)

Iterates over Buffer bytes from position() to limit() and lets BulkOperation examine/change the buffer content;

Parameters
operation:CompositeBuffer.BulkOperation

BulkOperation

Returns:int

Buffer position the processing was stopped on, or -1, if processing reached the limit.

bulkback to summary
public abstract int bulk(CompositeBuffer.BulkOperation operation, int position, int limit)

Iterates over Buffer bytes from position to limit and lets BulkOperation examine/change the buffer content;

Parameters
operation:CompositeBuffer.BulkOperation

BulkOperation

Returns:int

Buffer position the processing was stopped on, or -1, if processing reached the limit.

disposeOrderback to summary
public CompositeBuffer.DisposeOrder disposeOrder()

Returns the order in which internal Buffers will be disposed.

Returns:CompositeBuffer.DisposeOrder

DisposeOrder

disposeOrderback to summary
public CompositeBuffer disposeOrder(final CompositeBuffer.DisposeOrder disposeOrder)

Sets the order in which internal Buffers will be disposed.

Returns:CompositeBuffer

this buffer

newBufferback to summary
public static CompositeBuffer newBuffer()

Construct CompositeBuffer.

Returns:CompositeBuffer

new CompositeBuffer

newBufferback to summary
public static CompositeBuffer newBuffer(final MemoryManager<E extends Buffer> memoryManager)
newBufferback to summary
public static CompositeBuffer newBuffer(final MemoryManager<E extends Buffer> memoryManager, final Buffer... buffers)
newBufferback to summary
public static CompositeBuffer newBuffer(final MemoryManager<E extends Buffer> memoryManager, final Buffer[] buffers, final boolean isReadOnly)
prependback to summary
public abstract CompositeBuffer prepend(Buffer buffer)

Redeclares org.glassfish.grizzly.Buffer.prepend.

Doc from org.glassfish.grizzly.Buffer.prepend.

Prepend data from header.position() to header.limit() to the current buffer. This will change the value returned by buffer()!

Annotations
@Override
removeAllback to summary
public abstract void removeAll()

Removes underlying Buffers, without disposing

replaceback to summary
public abstract boolean replace(Buffer oldBuffer, Buffer newBuffer)

Replace one internal Buffer with another one.

Parameters
oldBuffer:Buffer

the Buffer to replace.

newBuffer:Buffer

the new Buffer.

Returns:boolean

true, if the oldBuffer was found and replaced, or false otherwise.

underlyingback to summary
public abstract Object[] underlying()

Redeclares org.glassfish.grizzly.Buffer.underlying.

Doc from org.glassfish.grizzly.Buffer.underlying.

Return the underlying buffer

Annotations
@Override
org.glassfish.grizzly.memory back to summary

public Interface CompositeBuffer.BulkOperation


Bulk Buffer operation, responsible for byte-by-byte Buffer processing.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true, if we want bulk processing stop, or false to continue processing.
processByte
(byte value, CompositeBuffer.Setter setter)

Method is responsible to examine/change one single Buffer's byte.

Method Detail

processByteback to summary
public boolean processByte(byte value, CompositeBuffer.Setter setter)

Method is responsible to examine/change one single Buffer's byte.

Parameters
setter:CompositeBuffer.Setter

Setter

Returns:boolean

true, if we want bulk processing stop, or false to continue processing.

org.glassfish.grizzly.memory back to summary

public final Enum CompositeBuffer.DisposeOrder

extends Enum<CompositeBuffer.DisposeOrder>
Class Inheritance

The order in which internal Buffers will be disposed.

Field Summary

Modifier and TypeField and Description
public static final CompositeBuffer.DisposeOrder
public static final CompositeBuffer.DisposeOrder

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static CompositeBuffer.DisposeOrder
public static CompositeBuffer.DisposeOrder[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

FIRST_TO_LASTback to summary
public static final CompositeBuffer.DisposeOrder FIRST_TO_LAST
LAST_TO_FIRSTback to summary
public static final CompositeBuffer.DisposeOrder LAST_TO_FIRST

Constructor Detail

DisposeOrderback to summary
private DisposeOrder()

Method Detail

valueOfback to summary
public static CompositeBuffer.DisposeOrder valueOf(String name)
valuesback to summary
public static CompositeBuffer.DisposeOrder[] values()
org.glassfish.grizzly.memory back to summary

public Interface CompositeBuffer.Setter

Known Direct Implementers
org.glassfish.grizzly.memory.BuffersBuffer.SetterImpl

Setter.

Method Summary

Modifier and TypeMethod and Description
public void
set(byte
value
value
)

Set the current byte value.

Method Detail

setback to summary
public void set(byte value)

Set the current byte value.

Parameters
value:byte

value