Creates a message that can be sent through a connection.
The type of the message.
The data payload of the message: string or Buffer for binary data.
Returns the message data in binary format.
Returns the message header in binary format, used when sending the message.
Returns true if the message data payload was received in full. This is only false while the message is being read.
Returns the lenght of the data payload (if any).
Returns the complete message in binary format, including the header.
Returns the total message lenght, including the header.
Returns the type of the message.
Append more data to the message payload.
Normally used when the message is being received through a connection untill the complete data is received.
The data chunk.
The offset where the new data chunk is to be appended.
Reads a message from a data buffer starting from a given offset.
This will return a message that can be complete or not depending if the whole message was present in the data buffer or not.
If not enough data present in the buffer to read at least the message header this returns null.
The buffer containing the message data to be parsed.
The start offset from where to start reading the message (defaults to zero).
This represent a message that can be sent between various akera.io components.
When sent first the message header is written (type and size) then the actual data payload.