Constructors
constructor
- new Decoder(options): Decoder
Parameters
- options: {
bufferSize: number;
maxMessageSize: number;
onError: ((msgBuffer: Uint8Array, errorMsg: string) => void);
onMessage: ((msg: Uint8Array) => void);
}bufferSize: number
maxMessageSize: number
onError: ((msgBuffer: Uint8Array, errorMsg: string) => void)
- (msgBuffer, errorMsg): void
Parameters
- msgBuffer: Uint8Array
- errorMsg: string
Returns void
onMessage: ((msg: Uint8Array) => void)
Methods
decode
- decode(data): Uint8Array
Parameters
- data: Buffer | ArrayLike<Uint8Array>
Returns Uint8Array