• Version 4.4.3
Show / Hide Table of Contents

Interface IEncoder

SBE encoder.

Namespace: OnixS.SimpleBinaryEncoding
Assembly: OnixS.SimpleBinaryEncoding.dll
Syntax
public interface IEncoder

Methods

Wrap(int, MemoryPointer)

Creates a new IMessage object and wraps the given memory region.

Declaration
IMessage Wrap(int templateId, MemoryPointer data)
Parameters
Type Name Description
int templateId

Message template ID.

MemoryPointer data

Pointer to the memory region.

Returns
Type Description
IMessage

A new IMessage object that can write SBE-encoded data to the given memory region.

Wrap(int, int)

Creates a new IMessage object and wraps a newly allocated memory region.

Declaration
IMessage Wrap(int templateId, int expectedMessageLength = 0)
Parameters
Type Name Description
int templateId

Message template id

int expectedMessageLength

Expected message length. - When 0 and the message size is fixed, this fixed message size will be used as the size of the newly allocated memory region. - When 0 and the message size is not fixed (e.g. contains repeating groups and/or variable length fields), then UInt16.MaxValue will be used as the size of the newly allocated memory region.

Returns
Type Description
IMessage

A new IMessage object that can write SBE-encoded data to the newly allocated memory region.

WrapPreCreatedMessage(int, MemoryPointer)

Returns a pre-created IMessage object wrapped around the given memory region.

Declaration
IMessage WrapPreCreatedMessage(int templateId, MemoryPointer data)
Parameters
Type Name Description
int templateId

Message template ID.

MemoryPointer data

Pointer to the memory region.

Returns
Type Description
IMessage

A pre-created IMessage object that can write SBE-encoded data to the given memory region.

WrapPreCreatedMessage(int, int)

Returns a pre-created IMessage object wrapped around a newly created memory region.

Declaration
IMessage WrapPreCreatedMessage(int templateId, int expectedMessageLength = 0)
Parameters
Type Name Description
int templateId

Message template ID.

int expectedMessageLength

Expected message length. - When 0 and the message size is fixed, this fixed message size will be used as the size of the newly allocated memory region. - When 0 and the message size is not fixed (e.g. contains repeating groups and/or variable length fields), then UInt16.MaxValue will be used as the size of the newly allocated memory region.

Returns
Type Description
IMessage

A pre-created IMessage object that can write SBE-encoded data to the newly allocated memory region.

In this article
Back to top Copyright © Onix Solutions.
Generated by DocFX