public abstract class ByteBufferReference extends Object
| Constructor and Description |
|---|
ByteBufferReference() |
| Modifier and Type | Method and Description |
|---|---|
abstract ByteBuffer |
getBufferRetain()
Return the data as a ByteBuffer after applying a
retain(). |
abstract boolean |
needsRelease()
Returns true if explicit calls to
release() are required for this
object to be eagerly released else they can be skipped (e.g. |
abstract int |
refCount()
Get the current reference count for this object.
|
abstract void |
release()
An optional explicit release of the underlying data.
|
abstract boolean |
retain()
Explicitly mark the buffer to be retained so it is not released until
a corresponding
release() has been invoked. |
abstract int |
size()
Size of the underlying data.
|
public abstract int refCount()
public abstract boolean retain()
release() has been invoked.public abstract ByteBuffer getBufferRetain()
public abstract void release()
NOTE: Implementations should never require this call to be invoked
(along with retain() and not lead to memory leaks if skipped.
Typically this means using NIO DirectByteBuffers for data which will
release automatically in the GC cycles when no references remain.
public abstract boolean needsRelease()
release() are required for this
object to be eagerly released else they can be skipped (e.g. heap buffers)public abstract int size()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.