|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.util.UtlListElement
com.neeve.sto.StoField
com.neeve.sto.StoBufferField
public final class StoBufferField
An STO field that holds a fixed length buffer.
Nested Class Summary | |
---|---|
static interface |
StoBufferField.ChangeNotifier
Interface through which buffer change notifications are dispatched. |
Nested classes/interfaces inherited from class com.neeve.sto.StoField |
---|
StoField.Type |
Field Summary |
---|
Fields inherited from class com.neeve.util.UtlListElement |
---|
count, head, next, prev |
Method Summary | |
---|---|
static StoBufferField |
create(ByteBuffer buffer,
int bufferOffset)
Create an STO fixed length buffer field from its serialized form. |
static StoBufferField |
create(String name,
int len)
Create an STO fixed length buffer field. |
static int |
getSerializedLength(ByteBuffer buffer,
int offset)
Get the length of a serialized buffer. |
ByteBuffer |
getValue()
Get the field value. |
ByteBuffer |
getValue(StoBufferField.ChangeNotifier notifier)
Get the field value and install a change notifier. |
boolean |
isVariableLength()
Implementation of StoField.isVariableLength() |
void |
reset()
Implementation of StoField.reset() |
static int |
shiftForPreamble(int val)
Shift a number by preamble length. |
Methods inherited from class com.neeve.sto.StoField |
---|
changeBackingBuffer, clearBackingBuffer, clone, contentsEquals, getBackingBuffer, getHeader, getLength, getName, getSerializedLength, getType, getVersion, isNamed, setBackingBuffer, shiftForHeader, sync, toString |
Methods inherited from class com.neeve.util.UtlListElement |
---|
count, insertAfter, insertBefore, isLinked, next, previous, unlink, wipe |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static StoBufferField create(String name, int len)
name
- The name of the field. A value of null will cause an unnamed
field to be created.len
- The length of the field. This value must be >= 0.public static StoBufferField create(ByteBuffer buffer, int bufferOffset)
buffer
- The buffer containing the serialized field.bufferOffset
- The offset into the buffer where the serialized
form of the field begins.public final boolean isVariableLength()
StoField.isVariableLength()
isVariableLength
in class StoField
public final void reset()
StoField.reset()
reset
in class StoField
public static int shiftForPreamble(int val)
public static int getSerializedLength(ByteBuffer buffer, int offset)
buffer
- The buffer containing the serialized buffer.offset
- The offset into the buffer where the bufferis serialized.
This method leaves the buffer markers intact.
public final ByteBuffer getValue()
It is important to note that the buffer returned from this methods can change across invocations. However, this can only happen if one or more operations were performed on the field between invocations that change the state of the backing buffer.
Note: This method leaves any installed change notifier in place.
public final ByteBuffer getValue(StoBufferField.ChangeNotifier notifier)
notifier
- The change notifier to install. The notifier will be
invoked when the buffer value returned by this method asynchronously
changes (e.g. due to backing buffer resizing etc). A value of null
will clear the installed notifier.
This method is the same as getValue()
except that it installs
a change notifier for the user to be asychronously notified of changes
to the returned buffer reference.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |