public abstract class SenseDataDescriptor extends Object implements ISerializable
Constructor and Description |
---|
SenseDataDescriptor(SenseDataDescriptorType descriptorType,
int additionalLength)
The abstract constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
serialize(ByteBuffer byteBuffer,
int index)
Inserts a serialized representation of the object into the specified
ByteBuffer . |
protected abstract void |
serializeSpecificFields(ByteBuffer byteBuffer,
int index)
Serializes all fields which are not common to all sense data descriptors, which means those that are
sub-type-specific.
|
int |
size()
Returns the size in bytes of the object's serialized representation.
|
public SenseDataDescriptor(SenseDataDescriptorType descriptorType, int additionalLength)
descriptorType
- determines the specific type of the sense data descriptoradditionalLength
- the length in bytes of all additional fieldsCOMMON_FIELDS_LENGTH
protected abstract void serializeSpecificFields(ByteBuffer byteBuffer, int index)
byteBuffer
- where the serialized fields will be storedindex
- the position of the first byte of the sense data descriptor in the ByteBuffer
public void serialize(ByteBuffer byteBuffer, int index)
ISerializable
ByteBuffer
. The serialized object
will occupy the byte positions from index to index + ISerializable.size()
- 1.serialize
in interface ISerializable
byteBuffer
- where to insert the serialized object representationindex
- the position of the first byte of the serialized object in the ByteBuffer
public int size()
ISerializable
size
in interface ISerializable
Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.