Class SimpleBufferAllocator.SimpleBuffer
java.lang.Object
org.apache.mina.core.buffer.IoBuffer
org.apache.mina.core.buffer.AbstractIoBuffer
org.apache.mina.core.buffer.SimpleBufferAllocator.SimpleBuffer
- All Implemented Interfaces:
Comparable<IoBuffer>
- Enclosing class:
SimpleBufferAllocator
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleBuffer(ByteBuffer buf) protectedSimpleBuffer(SimpleBufferAllocator.SimpleBuffer parent, ByteBuffer buf) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]array()intprotected IoBufferImplement this method to return the unexpandable read only version of this buffer.buf()protected voidbuf(ByteBuffer buf) Sets the underlying NIO buffer instance.protected IoBufferImplement this method to return the unexpandable duplicate of this buffer.voidfree()Declares this buffer and all its derived buffers are not used anymore so that it can be reused by someIoBufferAllocatorimplementations.booleanhasArray()protected IoBufferslice0()Implement this method to return the unexpandable slice of this buffer.Methods inherited from class AbstractIoBuffer
asCharBuffer, asDoubleBuffer, asFloatBuffer, asInputStream, asIntBuffer, asLongBuffer, asOutputStream, asReadOnlyBuffer, asShortBuffer, capacity, capacity, clear, compact, compareTo, duplicate, equals, expand, expand, fill, fill, fillAndReset, fillAndReset, flip, get, get, get, get, getChar, getChar, getDouble, getDouble, getEnum, getEnum, getEnumInt, getEnumInt, getEnumSet, getEnumSet, getEnumSetInt, getEnumSetInt, getEnumSetLong, getEnumSetLong, getEnumSetShort, getEnumSetShort, getEnumShort, getEnumShort, getFloat, getFloat, getInt, getInt, getLong, getLong, getMediumInt, getMediumInt, getObject, getObject, getPrefixedString, getPrefixedString, getShort, getShort, getSlice, getSlice, getString, getString, getUnsigned, getUnsigned, getUnsignedInt, getUnsignedInt, getUnsignedMediumInt, getUnsignedMediumInt, getUnsignedShort, getUnsignedShort, hashCode, hasRemaining, indexOf, isAutoExpand, isAutoShrink, isDerived, isDirect, isReadOnly, limit, limit, mark, markValue, minimumCapacity, minimumCapacity, order, order, position, position, prefixedDataAvailable, prefixedDataAvailable, put, put, put, put, put, put, putChar, putChar, putDouble, putDouble, putEnum, putEnum, putEnumInt, putEnumInt, putEnumSet, putEnumSet, putEnumSetInt, putEnumSetInt, putEnumSetLong, putEnumSetLong, putEnumSetShort, putEnumSetShort, putEnumShort, putEnumShort, putFloat, putFloat, putInt, putInt, putLong, putLong, putMediumInt, putMediumInt, putObject, putPrefixedString, putPrefixedString, putPrefixedString, putPrefixedString, putShort, putShort, putString, putString, putUnsigned, putUnsigned, putUnsigned, putUnsigned, putUnsigned, putUnsigned, putUnsigned, putUnsigned, putUnsignedInt, putUnsignedInt, putUnsignedInt, putUnsignedInt, putUnsignedInt, putUnsignedInt, putUnsignedInt, putUnsignedInt, putUnsignedShort, putUnsignedShort, putUnsignedShort, putUnsignedShort, putUnsignedShort, putUnsignedShort, putUnsignedShort, putUnsignedShort, remaining, reset, rewind, setAutoExpand, setAutoShrink, shrink, skip, slice, sweep, sweep, toStringMethods inherited from class IoBuffer
allocate, allocate, getAllocator, getHexDump, getHexDump, getHexDump, getHexDump, isUseDirectBuffer, normalizeCapacity, setAllocator, setUseDirectBuffer, wrap, wrap, wrap
-
Field Details
-
buf
-
-
Constructor Details
-
SimpleBuffer
-
SimpleBuffer
-
-
Method Details
-
buf
- Specified by:
bufin classIoBuffer- Returns:
- the underlying NIO
ByteBufferinstance.
-
buf
Description copied from class:AbstractIoBufferSets the underlying NIO buffer instance.- Specified by:
bufin classAbstractIoBuffer- Parameters:
buf- The buffer to store within this IoBuffer
-
duplicate0
Description copied from class:AbstractIoBufferImplement this method to return the unexpandable duplicate of this buffer.- Specified by:
duplicate0in classAbstractIoBuffer- Returns:
- the IoBoffer instance
-
slice0
Description copied from class:AbstractIoBufferImplement this method to return the unexpandable slice of this buffer.- Specified by:
slice0in classAbstractIoBuffer- Returns:
- the IoBoffer instance
-
asReadOnlyBuffer0
Description copied from class:AbstractIoBufferImplement this method to return the unexpandable read only version of this buffer.- Specified by:
asReadOnlyBuffer0in classAbstractIoBuffer- Returns:
- the IoBoffer instance
-
array
-
arrayOffset
public int arrayOffset()- Specified by:
arrayOffsetin classIoBuffer- Returns:
- The offset in the returned byte[] when the
IoBuffer.array()method is called - See Also:
-
hasArray
public boolean hasArray()- Specified by:
hasArrayin classIoBuffer- Returns:
trueif theIoBuffer.array()method will return a byte[]- See Also:
-
free
public void free()Description copied from class:IoBufferDeclares this buffer and all its derived buffers are not used anymore so that it can be reused by someIoBufferAllocatorimplementations. It is not mandatory to call this method, but you might want to invoke this method for maximum performance.
-