Class Encoder
FIX-to-FAST Encoder.
Inherited Members
Namespace: OnixS.Fix.Fast
Assembly: OnixS.Fix.Engine.dll
Syntax
public class Encoder : Coder
Constructors
Encoder(Stream, Dictionary)
Constructor.
Declaration
public Encoder(Stream templateStream, Dictionary fixDictionary)
Parameters
Type | Name | Description |
---|---|---|
Stream | templateStream | Stream with content of the FAST template. |
Dictionary | fixDictionary | The FIX dictionary to use. |
Encoder(Stream, Dictionary, Boolean)
Constructor.
Declaration
public Encoder(Stream templateStream, Dictionary fixDictionary, bool codeEachMessageIndependently)
Parameters
Type | Name | Description |
---|---|---|
Stream | templateStream | Stream with content of the FAST template. |
Dictionary | fixDictionary | The FIX dictionary to use. |
Boolean | codeEachMessageIndependently | Option to reset the previous values dictionaries. |
Methods
Encode(Message)
Encodes the given FIX message into a FAST stream chunk. The template is selected automatically with the max id for the specific FIX message type.
Declaration
public virtual byte[] Encode(Message message)
Parameters
Type | Name | Description |
---|---|---|
Message | message | Input FIX message. |
Returns
Type | Description |
---|---|
Byte[] | FAST-encoded data that represents the encoded message. |
Exceptions
Type | Condition |
---|---|
FastException | If encoding failed. |
Encode(Message, ByteBuffer)
Declaration
public virtual void Encode(Message message, ByteBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
Message | message | Input FIX message. |
ByteBuffer | buffer | Buffer to receive th FAST-encoded data that represents the encoded message. |
Exceptions
Type | Condition |
---|---|
FastException | If encoding failed. |
Encode(Message, Int32)
Encodes the given FIX message into a FAST stream chunk.
Declaration
public virtual byte[] Encode(Message message, int templateId)
Parameters
Type | Name | Description |
---|---|---|
Message | message | Input FIX message. |
Int32 | templateId | Template id to use. |
Returns
Type | Description |
---|---|
Byte[] | FAST-encoded data that represents the encoded message. |
Exceptions
Type | Condition |
---|---|
FastException | If encoding failed. |
Encode(Message, Int32, ByteBuffer)
Declaration
public virtual void Encode(Message message, int templateId, ByteBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
Message | message | Input FIX message. |
Int32 | templateId | Template id to use. |
ByteBuffer | buffer | Buffer to receive th FAST-encoded data that represents the encoded message. |
Exceptions
Type | Condition |
---|---|
FastException | If encoding failed. |
EncodeByteVector(Byte[])
Encodes byte array to the FAST byteVector format.
Declaration
public static byte[] EncodeByteVector(byte[] value)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | value | Array to encode. |
Returns
Type | Description |
---|---|
Byte[] | Byte array with encoded value. |
EncodeInt32(Int32)
Encodes signed 32-bit integer value to the FAST int32 format.
Declaration
public static byte[] EncodeInt32(int value)
Parameters
Type | Name | Description |
---|---|---|
Int32 | value | Value to encode. |
Returns
Type | Description |
---|---|
Byte[] | Byte array with encoded value. |
EncodeUInt32(UInt32)
Encodes unsigned 32-bit integer to the FAST uInt32 format.
Declaration
public static byte[] EncodeUInt32(uint value)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | value | Value to encode. |
Returns
Type | Description |
---|---|
Byte[] | Byte array with encoded value. |