Discard all parser state and start afresh. Called when a (re)connection begins so a new stream is parsed from a clean slate.
Feed a chunk of raw stream data into the parser.
Accepts bytes (a Buffer, as delivered by a node:net socket, is a
Uint8Array) or an already decoded string. Bytes are run through a StringDecoder so that a
multi-byte UTF-8 character split across two chunks is reassembled instead
of corrupted.
The bytes (or string) received from the socket.
Incrementally parses an XMPP component stream.
Feed it raw socket chunks via ComponentParser#write; it emits stream-start, per-stanza and stream-end events through the handlers passed to the constructor. Robust to a stanza (or a single multi-byte character) being split across arbitrary chunk boundaries.