Class: PackedMessage
A packed message represents an ordinary Message, but in a compressed format. This is useful in case you need to retain a large number or messages in memory, and reduce memory overhead.
The only way to create a packed message is by invoking the 'Message.pack' method.
Properties
type
type:
DataDictionary
The type of the packed message. This is a reference to the data dictionary that was used to pack the message.
Example
// Pack message
const packedMsg = message.pack();
const type = packedMsg.type; // Returns the data dictionary used to pack the message
// Unpack message
const unpackedMsg = packedMsg.unpack();
Methods
unpack()
unpack():
Message
Unpacks a previously packed message.
Returns
Unpacked Message
Example
// Pack message
const packedMsg = message.pack();
// Unpack message
const unpackedMsg = packedMsg.unpack();