![]() |
Diffusion .NET Classic API - Core and Common
5.9.4
|
Diffusion message utilities. More...
Static Public Member Functions | |
static int | GetStaticHeaderLength () |
Get the static header length. More... | |
static string | StringToInternalFormat (string message) |
Takes a String which may contain display representation of special bytes and converts those to actual internal bytes. More... | |
static string | StringToDisplayFormat (string message) |
Takes a string which may contain internal message delimiter bytes and converts them to a display format. More... | |
static int | GetMessageLength (ByteBuffer buffer) |
Get the message length out of a buffer. More... | |
static void | SetMessageLength (ByteBuffer buffer, int length) |
Sets the message buffer's limit to the specified length and also sets the message length field in the buffer. More... | |
static void | SetMessageType (ByteBuffer buffer, byte type) |
Sets the message type in a buffer. More... | |
static byte | GetMessageType (ByteBuffer buffer) |
Returns the message type from a buffer. More... | |
static string | GetMessageType (byte type) |
Returns the message type as a 'human readable' string. More... | |
static void | SetMessageEncoding (ByteBuffer buffer, byte encoding) |
Sets the message encoding in a buffer. More... | |
static byte | GetMessageEncoding (ByteBuffer buffer) |
Returns the message encoding from a buffer. More... | |
static string | GetMessageEncoding (byte encoding) |
Returns the message encoding as a 'human readable' string. More... | |
static void | Decode (ByteBuffer input, ByteBuffer output, int headerLength) |
Decodes an input buffer and writes the result to an output buffer. More... | |
static bool | Encode (ByteBuffer input, ByteBuffer output, int headerLength) |
Encodes the body part of an input buffer into an output buffer. More... | |
static void | CopyMessageHeader (ByteBuffer input, ByteBuffer output, int headerLength) |
Copies the header from one buffer to another. Buffers positions on entry do not matter. The input buffer position is not affected by this operation. On completion, the output buffer position and limit will be the header length. More... | |
static void | CopyMessageBody (ByteBuffer inputBuffer, int inputHeaderLength, ByteBuffer buffer, int headerLength) |
Copy the body of one message to another, also setting the encoding. This position of the input buffer is not changed by this operation. The output buffer will be positioned at the end of the data on exit. More... | |
static byte[] | GetRemaining (ByteBuffer buffer) |
Gets the remainder of a buffer from the current position into a byte buffer. More... | |
static string | GetUntil (ByteBuffer buffer, byte delim) |
static string[] | SplitUntil (ByteBuffer buffer, byte splitDelim, byte untilDelim) |
Splits the incoming byte buffer into an array of strings separated by the 'split' delimiter until hitting the 'until' delimiter. More... | |
static int | CalculateMessageCapacity (string topicName, int dataCapacity) |
Calculates the message capacity required for a topic message. This always assumes a full topic name and does not cater for the saving achieved by aliases - so will always overassign space but this is not really a problem. More... | |
static int | CalculateInitialMessageSize (int capacity, params string[] headers) |
Calculate the initial size of a message given its initial data capacity and any fixed headers. More... | |
Static Public Attributes | |
static string | fieldDelimiterDisplay = "<FD>" |
The 'human readable' version of a Diffusion field delimiter. More... | |
static string | recordDelimiterDisplay = "<RD>" |
The 'human readable' version of a Diffusion record delimiter. More... | |
static string | messageDelimiterDisplay = "<MD>" |
The 'human readable' version of a Diffusion message delimiter. More... | |
static string | emptyFieldDisplay = "<EF>" |
The 'human readable' version of a Diffusion empty field. More... | |
static char | emptyFieldDelimiterChar = (char) 0x03 |
Empty field delimiter character. More... | |
static char | fieldDelimiterChar = (char) 0x02 |
Field delimiter character. More... | |
static char | recordDelimiterChar = (char) 0x01 |
Record delimiter character. More... | |
static char | messageDelimiterChar = (char) 0x00 |
Message delimiter character. More... | |
static string | emptyFieldDelimiterString |
Empty delimiter character. More... | |
static string | fieldDelimiterString |
The string representing a field delimiter. More... | |
static string | recordDelimiterString |
The string representing a record delimiter. More... | |
static string | messageDelimiterString |
The string representing a message delimiter. More... | |
static int | minimumMaxMessageSize = 8 |
The (minimum) maximum message size. More... | |
Diffusion message utilities.
|
static |
Calculate the initial size of a message given its initial data capacity and any fixed headers.
capacity | |
headers |
|
static |
Calculates the message capacity required for a topic message. This always assumes a full topic name and does not cater for the saving achieved by aliases - so will always overassign space but this is not really a problem.
topicName | |
dataCapacity |
|
static |
Copy the body of one message to another, also setting the encoding. This position of the input buffer is not changed by this operation. The output buffer will be positioned at the end of the data on exit.
inputBuffer | |
inputHeaderLength | |
buffer | |
headerLength |
|
static |
Copies the header from one buffer to another. Buffers positions on entry do not matter. The input buffer position is not affected by this operation. On completion, the output buffer position and limit will be the header length.
input | |
output | |
headerLength |
|
static |
Decodes an input buffer and writes the result to an output buffer.
input | |
output | |
headerLength |
|
static |
Encodes the body part of an input buffer into an output buffer.
input | |
output | |
headerLength |
|
static |
Returns the message encoding from a buffer.
buffer |
|
static |
Returns the message encoding as a 'human readable' string.
encoding |
|
static |
Get the message length out of a buffer.
buffer |
|
static |
Returns the message type from a buffer.
buffer |
|
static |
Returns the message type as a 'human readable' string.
type |
|
static |
Gets the remainder of a buffer from the current position into a byte buffer.
buffer |
|
static |
Get the static header length.
|
static |
buffer | |
delim |
|
static |
Sets the message encoding in a buffer.
buffer | |
encoding |
|
static |
Sets the message buffer's limit to the specified length and also sets the message length field in the buffer.
buffer | |
length |
|
static |
Sets the message type in a buffer.
buffer | |
type |
|
static |
Splits the incoming byte buffer into an array of strings separated by the 'split' delimiter until hitting the 'until' delimiter.
buffer | |
splitDelim | |
untilDelim |
|
static |
Takes a string which may contain internal message delimiter bytes and converts them to a display format.
message |
|
static |
Takes a String which may contain display representation of special bytes and converts those to actual internal bytes.
message |
|
static |
Empty field delimiter character.
|
static |
Empty delimiter character.
|
static |
The 'human readable' version of a Diffusion empty field.
|
static |
Field delimiter character.
|
static |
The 'human readable' version of a Diffusion field delimiter.
|
static |
The string representing a field delimiter.
|
static |
Message delimiter character.
|
static |
The 'human readable' version of a Diffusion message delimiter.
|
static |
The string representing a message delimiter.
|
static |
The (minimum) maximum message size.
|
static |
Record delimiter character.
|
static |
The 'human readable' version of a Diffusion record delimiter.
|
static |
The string representing a record delimiter.