|
|||||||||
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.StoVariableLengthField<StoFieldContainer>
com.neeve.sto.StoCompoundField
public final class StoCompoundField
An STO field that holds a compound value.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.neeve.sto.StoField |
---|
StoField.Type |
Field Summary | |
---|---|
static int |
HEADER_LENGTH
|
Fields inherited from class com.neeve.util.UtlListElement |
---|
count, head, next, prev |
Method Summary | |
---|---|
static StoCompoundField |
create(ByteBuffer buffer,
int bufferOffset)
Create an STO compound field from its serialized form. |
static StoCompoundField |
create(String name)
Create an STO compound field. |
static StoFieldContainer |
get(ByteBuffer buffer,
int offset)
Deserialize an STO field container. |
static int |
getBodySerializedLength(ByteBuffer buffer,
int offset)
Get the length of a serialized body of a compound value. |
static int |
getBodySerializedLength(StoFieldContainer val)
Get the serialized length of the body of a compound value |
static int |
getSerializedLength(ByteBuffer buffer,
int offset)
Get the length of a serialized compound value. |
static int |
getSerializedLength(StoFieldContainer val)
Get the serialized length of a compound value. |
static int |
put(ByteBuffer buffer,
int offset,
StoFieldContainer val)
Serialize an STO field container as a compound field body. |
Methods inherited from class com.neeve.sto.StoVariableLengthField |
---|
getValue, isVariableLength, reset, setValue |
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 |
Field Detail |
---|
public static final int HEADER_LENGTH
Method Detail |
---|
public static StoCompoundField create(String name)
name
- The name of the field. A value of null will cause an unnamed
field to be created.public static StoCompoundField 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 static final int getBodySerializedLength(ByteBuffer buffer, int offset)
A compound field serializes its value preceded by a header (containing type information, etc). This method returns the length of the serialized portion excluding the header portion.
public static int getSerializedLength(ByteBuffer buffer, int offset)
buffer
- The buffer containing the serialized value.offset
- The offset into the buffer where the value is serialized.
The value returned by this method is HEADER_LENGTH
+ the
value returned by getBodySerializedLength(ByteBuffer, int)
This method leaves the buffer markers intact.
public static final int getBodySerializedLength(StoFieldContainer val)
public static int getSerializedLength(StoFieldContainer val)
val
- The compound value whose serialized length is to be returned.
The value returned by this method is HEADER_LENGTH
+ the
valkue returned by getBodySerializedLength(StoFieldContainer)
public static int put(ByteBuffer buffer, int offset, StoFieldContainer val)
buffer
- The buffer in which to serialize the array.offset
- The offset into the buffer at which point to serialize
the container.
A field container, when serialized, does not serialize any preamble
information regarding serialized length. Therefore, to deserialize a
container (using StoFieldContainer.create(ByteBuffer)
), the user
needs to manage the buffer markers such that the 'remaining' bytes
in te buffer exactly contain the serialized container. This works well
for root containers. However, for embedded containers, information
needs to be serialized so that the deserialization process can ascertain
the serialized length from the wire. This method performs that.
This method always syncs the container to the specified buffer.
This method leaves the buffer markers intact.
public static StoFieldContainer get(ByteBuffer buffer, int offset)
buffer
- The byte array from which to deserialize the value.offset
- The offset into the array from which to deserialize the
array.
This method works to deserialize field containers serialized using
put(java.nio.ByteBuffer, int, com.neeve.sto.StoFieldContainer)
This method leaves the buffer markers intact.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |