Interface IFrameDecoder<Frame>

interface IFrameDecoder<Frame = Uint8Array> {
    decode: (buf: Bytes, eof: boolean) => MaybePromise<null | Frame>;
}

Type Parameters

  • Frame = Uint8Array

Implemented by

Properties

Properties

decode: (buf: Bytes, eof: boolean) => MaybePromise<null | Frame>

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