|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fulmine.protocol.specification.FieldWriter
public final class FieldWriter
Utility methods for writing fields into byte[] form. This is an implementation of the fulmine delta (FD) protocol. Writing a component includes writing the identity of the component (as a component spec) and the value of the component. This technique is covered in the "Fulmine Delta Transmission Protocol" specification.
If a component has an integer wire format (IWF), the component spec is:
| 1 byte | fbc bytes | dbc bytes | ------------------------------------------------------- | 7 6 5 4 3 2 1 0 | | | ------------------------------------------------------- | fbc | dbc | component | dpos |Otherwise (for string wire format - SWF) it is:
| 1 byte | 1 byte | fbc bytes | dbc bytes | ------------------------------------------------------- | | | | | ------------------------------------------------------- | fbc | dbc | component | dpos |
FieldReader
Constructor Summary | |
---|---|
FieldWriter()
|
Method Summary | |
---|---|
static void |
writeBooleanField(IWireIdentity wireId,
boolean data,
byte[][] headerBuffer,
int[] headerBufferPosition,
byte[][] dataBuffer,
int[] dataBufferPosition)
Write the component spec for a boolean component represented by the wireId to the buffer held in headerBuffer[0] starting at headerBufferPosition[0]. |
static void |
writeDoubleField(IWireIdentity wireId,
double data,
byte[][] headerBuffer,
int[] headerBufferPosition,
byte[][] dataBuffer,
int[] dataBufferPosition)
Write the component spec for a double component represented by the wireId to the buffer held in headerBuffer[0] starting at headerBufferPosition[0]. |
static void |
writeFloatField(IWireIdentity wireId,
float data,
byte[][] headerBuffer,
int[] headerBufferPosition,
byte[][] dataBuffer,
int[] dataBufferPosition)
Write the component spec for a float component represented by the wireId to the buffer held in headerBuffer[0] starting at headerBufferPosition[0]. |
static void |
writeIntegerField(IWireIdentity wireId,
int data,
byte[][] headerBuffer,
int[] headerBufferPosition,
byte[][] dataBuffer,
int[] dataBufferPosition)
Write the component spec for an integer component represented by the wireId to the buffer held in headerBuffer[0] starting at headerBufferPosition[0]. |
static void |
writeLongField(IWireIdentity wireId,
long data,
byte[][] headerBuffer,
int[] headerBufferPosition,
byte[][] dataBuffer,
int[] dataBufferPosition)
Write the component spec for a long component represented by the wireId to the buffer held in headerBuffer[0] starting at headerBufferPosition[0]. |
static void |
writeRawBytesField(IWireIdentity wireId,
byte[] data,
byte[][] headerBuffer,
int[] headerBufferPosition,
byte[][] dataBuffer,
int[] dataBufferPosition)
Write the component spec for a raw byte[] component represented by the wireId to the buffer held in headerBuffer[0] starting at headerBufferPosition[0]. |
static void |
writeStringField(IWireIdentity wireId,
String data,
byte[][] headerBuffer,
int[] headerBufferPosition,
byte[][] dataBuffer,
int[] dataBufferPosition)
Write the component spec for a String component represented by the wireId to the buffer held in headerBuffer[0] starting at headerBufferPosition[0]. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FieldWriter()
Method Detail |
---|
public static void writeRawBytesField(IWireIdentity wireId, byte[] data, byte[][] headerBuffer, int[] headerBufferPosition, byte[][] dataBuffer, int[] dataBufferPosition)
When this method completes, headerBufferPosition[0] points to the end of the data in headerBuffer[0] and, similarly, dataBufferPosition[0] points to the end of the data in dataBufferPosition[0].
wireId
- the 'wire' identity of the component to write in the component
specdata
- the data to write to the buffer held in dataBuffer[0]headerBuffer
- headerBuffer[0] holds the buffer for the header, this is where
the component spec is written toheaderBufferPosition
- headerBufferPosition[0] points to the position in
headerBuffer[0] where the component spec should be written to.
When this method completes, headerBufferPosition[0] points to
the end of the header data in headerDataBuffer[0]dataBuffer
- dataBuffer[0] holds the buffer for the datadataBufferPosition
- dataBufferPosition[0] points to the position in dataBuffer[0]
where the data should be written to. When this method
completes, dataBufferPosition[0] points to the end of the data
in dataBuffer[0]public static void writeIntegerField(IWireIdentity wireId, int data, byte[][] headerBuffer, int[] headerBufferPosition, byte[][] dataBuffer, int[] dataBufferPosition)
When this method completes, headerBufferPosition[0] points to the end of the data in headerBuffer[0] and, similarly, dataBufferPosition[0] points to the end of the data in dataBufferPosition[0].
wireId
- the 'wire' identity of the component to write in the component
specdata
- the data to write to the buffer held in dataBuffer[0]headerBuffer
- headerBuffer[0] holds the buffer for the header, this is where
the component spec is written toheaderBufferPosition
- headerBufferPosition[0] points to the position in
headerBuffer[0] where the component spec should be written to.
When this method completes, headerBufferPosition[0] points to
the end of the header data in headerDataBuffer[0]dataBuffer
- dataBuffer[0] holds the buffer for the datadataBufferPosition
- dataBufferPosition[0] points to the position in dataBuffer[0]
where the data should be written to. When this method
completes, dataBufferPosition[0] points to the end of the data
in dataBuffer[0]public static void writeLongField(IWireIdentity wireId, long data, byte[][] headerBuffer, int[] headerBufferPosition, byte[][] dataBuffer, int[] dataBufferPosition)
When this method completes, headerBufferPosition[0] points to the end of the data in headerBuffer[0] and, similarly, dataBufferPosition[0] points to the end of the data in dataBufferPosition[0].
wireId
- the 'wire' identity of the component to write in the component
specdata
- the data to write to the buffer held in dataBuffer[0]headerBuffer
- headerBuffer[0] holds the buffer for the header, this is where
the component spec is written toheaderBufferPosition
- headerBufferPosition[0] points to the position in
headerBuffer[0] where the component spec should be written to.
When this method completes, headerBufferPosition[0] points to
the end of the header data in headerDataBuffer[0]dataBuffer
- dataBuffer[0] holds the buffer for the datadataBufferPosition
- dataBufferPosition[0] points to the position in dataBuffer[0]
where the data should be written to. When this method
completes, dataBufferPosition[0] points to the end of the data
in dataBuffer[0]public static void writeFloatField(IWireIdentity wireId, float data, byte[][] headerBuffer, int[] headerBufferPosition, byte[][] dataBuffer, int[] dataBufferPosition)
When this method completes, headerBufferPosition[0] points to the end of the data in headerBuffer[0] and, similarly, dataBufferPosition[0] points to the end of the data in dataBufferPosition[0].
wireId
- the 'wire' identity of the component to write in the component
specdata
- the data to write to the buffer held in dataBuffer[0]headerBuffer
- headerBuffer[0] holds the buffer for the header, this is where
the component spec is written toheaderBufferPosition
- headerBufferPosition[0] points to the position in
headerBuffer[0] where the component spec should be written to.
When this method completes, headerBufferPosition[0] points to
the end of the header data in headerDataBuffer[0]dataBuffer
- dataBuffer[0] holds the buffer for the datadataBufferPosition
- dataBufferPosition[0] points to the position in dataBuffer[0]
where the data should be written to. When this method
completes, dataBufferPosition[0] points to the end of the data
in dataBuffer[0]public static void writeDoubleField(IWireIdentity wireId, double data, byte[][] headerBuffer, int[] headerBufferPosition, byte[][] dataBuffer, int[] dataBufferPosition)
When this method completes, headerBufferPosition[0] points to the end of the data in headerBuffer[0] and, similarly, dataBufferPosition[0] points to the end of the data in dataBufferPosition[0].
wireId
- the 'wire' identity of the component to write in the component
specdata
- the data to write to the buffer held in dataBuffer[0]headerBuffer
- headerBuffer[0] holds the buffer for the header, this is where
the component spec is written toheaderBufferPosition
- headerBufferPosition[0] points to the position in
headerBuffer[0] where the component spec should be written to.
When this method completes, headerBufferPosition[0] points to
the end of the header data in headerDataBuffer[0]dataBuffer
- dataBuffer[0] holds the buffer for the datadataBufferPosition
- dataBufferPosition[0] points to the position in dataBuffer[0]
where the data should be written to. When this method
completes, dataBufferPosition[0] points to the end of the data
in dataBuffer[0]public static void writeStringField(IWireIdentity wireId, String data, byte[][] headerBuffer, int[] headerBufferPosition, byte[][] dataBuffer, int[] dataBufferPosition)
When this method completes, headerBufferPosition[0] points to the end of the data in headerBuffer[0] and, similarly, dataBufferPosition[0] points to the end of the data in dataBufferPosition[0].
wireId
- the 'wire' identity of the component to write in the component
specdata
- the data to write to the buffer held in dataBuffer[0]headerBuffer
- headerBuffer[0] holds the buffer for the header, this is where
the component spec is written toheaderBufferPosition
- headerBufferPosition[0] points to the position in
headerBuffer[0] where the component spec should be written to.
When this method completes, headerBufferPosition[0] points to
the end of the header data in headerDataBuffer[0]dataBuffer
- dataBuffer[0] holds the buffer for the datadataBufferPosition
- dataBufferPosition[0] points to the position in dataBuffer[0]
where the data should be written to. When this method
completes, dataBufferPosition[0] points to the end of the data
in dataBuffer[0]public static void writeBooleanField(IWireIdentity wireId, boolean data, byte[][] headerBuffer, int[] headerBufferPosition, byte[][] dataBuffer, int[] dataBufferPosition)
When this method completes, headerBufferPosition[0] points to the end of the data in headerBuffer[0] and, similarly, dataBufferPosition[0] points to the end of the data in dataBufferPosition[0].
wireId
- the 'wire' identity of the component to write in the component
specdata
- the data to write to the buffer held in dataBuffer[0]headerBuffer
- headerBuffer[0] holds the buffer for the header, this is where
the component spec is written toheaderBufferPosition
- headerBufferPosition[0] points to the position in
headerBuffer[0] where the component spec should be written to.
When this method completes, headerBufferPosition[0] points to
the end of the header data in headerDataBuffer[0]dataBuffer
- dataBuffer[0] holds the buffer for the datadataBufferPosition
- dataBufferPosition[0] points to the position in dataBuffer[0]
where the data should be written to. When this method
completes, dataBufferPosition[0] points to the end of the data
in dataBuffer[0]
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |