Package com.google.code.yanf4j.buffer
Class CachedBufferAllocator.CachedBuffer
java.lang.Object
com.google.code.yanf4j.buffer.IoBuffer
com.google.code.yanf4j.buffer.AbstractIoBuffer
com.google.code.yanf4j.buffer.CachedBufferAllocator.CachedBuffer
- All Implemented Interfaces:
Comparable<IoBuffer>
- Enclosing class:
CachedBufferAllocator
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CachedBuffer
(CachedBufferAllocator.CachedBuffer parent, ByteBuffer buf) protected
CachedBuffer
(ByteBuffer buf) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
array()
int
protected IoBuffer
Implement this method to return the unexpandable read only version of this buffer.buf()
Returns the underlying NIO buffer instance.protected void
buf
(ByteBuffer buf) Sets the underlying NIO buffer instance.protected IoBuffer
Implement this method to return the unexpandable duplicate of this buffer.void
free()
Declares this buffer and all its derived buffers are not used anymore so that it can be reused by someIoBufferAllocator
implementations.private void
free
(ByteBuffer oldBuf) boolean
hasArray()
protected IoBuffer
slice0()
Implement this method to return the unexpandable slice of this buffer.Methods inherited from class com.google.code.yanf4j.buffer.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, getHexDump, getHexDump, 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, remaining, reset, rewind, setAutoExpand, setAutoShrink, shrink, skip, slice, sweep, sweep, toString
Methods inherited from class com.google.code.yanf4j.buffer.IoBuffer
allocate, allocate, getAllocator, isUseDirectBuffer, normalizeCapacity, setAllocator, setUseDirectBuffer, wrap, wrap, wrap
-
Field Details
-
ownerThread
-
buf
-
-
Constructor Details
-
CachedBuffer
-
CachedBuffer
-
-
Method Details
-
buf
Description copied from class:IoBuffer
Returns the underlying NIO buffer instance. -
buf
Description copied from class:AbstractIoBuffer
Sets the underlying NIO buffer instance.- Specified by:
buf
in classAbstractIoBuffer
- Parameters:
buf
- The buffer to store within this IoBuffer
-
duplicate0
Description copied from class:AbstractIoBuffer
Implement this method to return the unexpandable duplicate of this buffer.- Specified by:
duplicate0
in classAbstractIoBuffer
-
slice0
Description copied from class:AbstractIoBuffer
Implement this method to return the unexpandable slice of this buffer.- Specified by:
slice0
in classAbstractIoBuffer
-
asReadOnlyBuffer0
Description copied from class:AbstractIoBuffer
Implement this method to return the unexpandable read only version of this buffer.- Specified by:
asReadOnlyBuffer0
in classAbstractIoBuffer
-
array
public byte[] array() -
arrayOffset
public int arrayOffset()- Specified by:
arrayOffset
in classIoBuffer
- See Also:
-
hasArray
public boolean hasArray() -
free
public void free()Description copied from class:IoBuffer
Declares this buffer and all its derived buffers are not used anymore so that it can be reused by someIoBufferAllocator
implementations. It is not mandatory to call this method, but you might want to invoke this method for maximum performance. -
free
-