Decode a frame from a buffer
Important implementation notice: When returning byte arrays, make sure that the returned array is not a view into the original buffer, as the underlying buffer may get invalidated
Encode a frame into a writable stream
Reset the encoder, should it have any internal state
Optional
setupFor codecs that use crypto functions and/or logging. This method is called before any other.
Initial tag of the codec. Will be sent immediately once connected.
Interface declaring handling of received packets. When receiving a packet, its content is sent to feed(), and codec is supposed to emit
packet
orerror
event when packet is parsed.