Creates a new stream framer.
Maximum allowed packet size
Gets the number of buffered bytes.
Clears all buffered data.
Pushes a chunk of data into the buffer.
The data chunk to add
Attempts to read a complete packet from the buffer.
If a complete packet is available, it is removed from the buffer and returned. If not enough data is available, returns incomplete. If the data is malformed, returns an error.
Frame result
A buffer that accumulates chunks and extracts complete packets.
This class handles the complexity of MQTT framing over a byte stream:
Example