Class ResizableMessage
The base class for resizable messages.
Inherited Members
Namespace: OnixS.SimpleBinaryEncoding
Assembly: OnixS.SimpleBinaryEncoding.dll
Syntax
public abstract class ResizableMessage
Fields
buffer
The underlying memory region.
Declaration
protected MemoryPointer buffer
Field Value
Type | Description |
---|---|
MemoryPointer |
Properties
Buffer
Declaration
public Span<byte> Buffer { get; }
Property Value
Type | Description |
---|---|
Span<byte> | The memory region. |
MessageLength
Declaration
public abstract ushort MessageLength { get; }
Property Value
Type | Description |
---|---|
ushort | The length of the entire message, including the binary header, in bytes. |
Methods
Resize(Span<byte>, int, int)
Resizes the message and copies the required data.
Declaration
protected void Resize(Span<byte> regionToResize, int oldSize, int newSize)
Parameters
Type | Name | Description |
---|---|---|
Span<byte> | regionToResize | The memory region to resize. |
int | oldSize | The old message size. |
int | newSize | The new message size. |
Exceptions
Type | Condition |
---|---|
BufferOverflowException | Thrown if the memory region does not have free space for a new repeating group. |
Wrap(MemoryPointer, bool)
Wraps the message around the given memory region.
Declaration
public void Wrap(MemoryPointer buffer, bool encode = false)
Parameters
Type | Name | Description |
---|---|---|
MemoryPointer | buffer | The memory region. |
bool | encode | If |
Wrap(MemoryPointer, bool, bool)
Wraps the message around the given memory region.
Declaration
protected abstract void Wrap(MemoryPointer buffer, bool encode, bool resetGroups)
Parameters
Type | Name | Description |
---|---|---|
MemoryPointer | buffer | The memory region. |
bool | encode | If |
bool | resetGroups | If |