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, IMessageInfoDictionary)
Constructor.
Declaration
public Encoder(Stream templateStream, IMessageInfoDictionary fixDictionary)
Parameters
Type | Name | Description |
---|---|---|
Stream | templateStream | Stream with content of the FAST template. |
IMessageInfoDictionary | fixDictionary | The FIX dictionary to use. |
Encoder(Stream, IMessageInfoDictionary, bool)
Constructor.
Declaration
public Encoder(Stream templateStream, IMessageInfoDictionary fixDictionary, bool codeEachMessageIndependently)
Parameters
Type | Name | Description |
---|---|---|
Stream | templateStream | Stream with content of the FAST template. |
IMessageInfoDictionary | fixDictionary | The FIX dictionary to use. |
bool | 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, int)
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. |
int | 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, int, ByteBuffer)
Declaration
public virtual void Encode(Message message, int templateId, ByteBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
Message | message | Input FIX message. |
int | 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(int)
Encodes signed 32-bit integer value to the FAST int32 format.
Declaration
public static byte[] EncodeInt32(int value)
Parameters
Type | Name | Description |
---|---|---|
int | value | Value to encode. |
Returns
Type | Description |
---|---|
byte[] | Byte array with encoded value. |
EncodeUInt32(uint)
Encodes unsigned 32-bit integer to the FAST uInt32 format.
Declaration
public static byte[] EncodeUInt32(uint value)
Parameters
Type | Name | Description |
---|---|---|
uint | value | Value to encode. |
Returns
Type | Description |
---|---|
byte[] | Byte array with encoded value. |