public class VariableLengthData
extends java.lang.Object
The field has a length, a units descriptor (bytes or bits) and a descriptor that tells us whether the record as a whole should end on a 8, 16, 32, or 64 bit word boundary, including the length field.
Modifier and Type | Class and Description |
---|---|
static class |
VariableLengthData.DataLengthUnits
What units does the length field use? Typically bytes (octet)
but also often bits.
|
static class |
VariableLengthData.PadToBoundary
We want the record as a whole to end on a byte, 16 bit word, 32 bit
word, or 64 bit word boundary, so we pad to reach that.
|
Modifier and Type | Field and Description |
---|---|
byte[] |
data |
long |
dataLength |
VariableLengthData.DataLengthUnits |
dataLengthUnits |
VariableLengthData.PadToBoundary |
padToBoundary |
Constructor and Description |
---|
VariableLengthData() |
Modifier and Type | Method and Description |
---|---|
byte[] |
getData()
Retrieves data, padded to at least a byte boundary
|
int |
getDataLength() |
int |
getMarshalledSize() |
void |
marshal(java.nio.ByteBuffer buff) |
void |
marshal(java.io.DataOutputStream dos) |
void |
setData(byte[] data)
Set the data to write.
|
void |
setDataLength(int dataLength) |
void |
unmarshal(java.nio.ByteBuffer buff) |
void |
unmarshal(java.io.DataInputStream dis) |
public long dataLength
public VariableLengthData.PadToBoundary padToBoundary
public VariableLengthData.DataLengthUnits dataLengthUnits
public byte[] data
public int getMarshalledSize()
public void setDataLength(int dataLength)
public int getDataLength()
public void setData(byte[] data)
data
- public byte[] getData()
public void marshal(java.io.DataOutputStream dos)
public void unmarshal(java.io.DataInputStream dis)
public void marshal(java.nio.ByteBuffer buff)
public void unmarshal(java.nio.ByteBuffer buff)