|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fulmine.protocol.specification.FrameWriter
public final class FrameWriter
A utility class for writing fulmine delta (FD) protocol frames.
Please refer to the "Fulmine Delta Transmission Protocol" specification for a complete description of the fulmine serialisation technique.
IFrameConstants
Constructor Summary | |
---|---|
FrameWriter()
Standard constructor. |
Method Summary | |
---|---|
static byte[] |
mergeBuffers(int[] headerBufferPosition,
byte[][] headerBuffer,
int[] dataBufferPosition,
byte[][] dataBuffer)
|
byte[] |
write(IContainer container)
Write a container's state into an FD frame. |
static byte[] |
write(IOperationScope scope,
IContainer container,
boolean completeState)
Write a container's current state changes into an FD frame. |
byte[] |
writeComplete(IContainer container)
Write a container's complete state into an FD frame. |
static void |
writeHeaderAndData(IContainer container,
Collection<? extends IComponent> components,
IWireIdentityRegistry registry,
IOperationScope scope,
byte[][] headerBuffer,
int[] headerBufferPosition,
byte[][] dataBuffer,
int[] dataBufferPosition,
boolean completeState)
Write the container and fields to the header and data buffers. |
byte[] |
writeMeta(IContainer container)
Write only a container's meta state into an FD frame. |
static byte[] |
writeNested(Collection<? extends IComponent> components,
IWireIdentityRegistry registry,
IOperationScope scope,
boolean completeState)
Write a nested container's state into a nested FD frame. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FrameWriter()
Method Detail |
---|
public static byte[] write(IOperationScope scope, IContainer container, boolean completeState)
scope
- the scope to use for the write operationcontainer
- the container to write as a framecompleteState
- whether to write the complete state or only changes
public byte[] writeComplete(IContainer container)
writeComplete
in interface IFrameWriter
container
- the container to write as a frame
public byte[] write(IContainer container)
write
in interface IFrameWriter
container
- the container to write as a frame
public byte[] writeMeta(IContainer container)
writeMeta
in interface IFrameWriter
container
- the container to write
public static byte[] writeNested(Collection<? extends IComponent> components, IWireIdentityRegistry registry, IOperationScope scope, boolean completeState)
----------------------------------------------------------------- | nested frame preamble | nested frame | ----------------------------------------------------------------- | 4 byte | 4 byte | header size bytes | data size bytes | ----------------------------------------------------------------- | header size | data size | header | data | -----------------------------------------------------------------Notice that there is no container identifier or any of the other fields found in the general container header.
fields
- the fields of the container to write into the frameregistry
- used to get the IWF wire codes for the fieldsscope
- the scope of the write operationcompleteState
- whether to write the complete state or only changes
public static byte[] mergeBuffers(int[] headerBufferPosition, byte[][] headerBuffer, int[] dataBufferPosition, byte[][] dataBuffer)
public static void writeHeaderAndData(IContainer container, Collection<? extends IComponent> components, IWireIdentityRegistry registry, IOperationScope scope, byte[][] headerBuffer, int[] headerBufferPosition, byte[][] dataBuffer, int[] dataBufferPosition, boolean completeState)
container
- the container to write into the header and data buffers of the
framefields
- the fields of the container to write into the frame, can be
null
registry
- used to get the IWF wire codes for the fieldsscope
- the scope of the write operationheaderBuffer
- headerBuffer[0] holds the buffer for the header of the frameheaderBufferPosition
- headerBufferPosition[0] points to the end of the header data
in headerDataBuffer[0]dataBuffer
- dataBuffer[0] holds the buffer for the data of the framedataBufferPosition
- dataBufferPosition[0] points to the end of the data in
dataBuffer[0]completeState
- whether to write the complete state or only changes
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |