Methods
Static decode
- decode<TMessage>(buffer: Uint8Array, decoder: ((reader: Reader, length: number) => TMessage), length?: number): TMessage
Type Parameters
Parameters
buffer: Uint8Array
decoder: ((reader: Reader, length: number) => TMessage)
- (reader: Reader, length: number): TMessage
Parameters
reader: Reader
length: number
Returns TMessage
length: number = -1
Returns TMessage
Static encode
- encode<TMessage>(message: TMessage, encoder: ((message: TMessage, writer: Writer) => void)): Uint8Array
Type Parameters
Parameters
message: TMessage
encoder: ((message: TMessage, writer: Writer) => void)
- (message: TMessage, writer: Writer): void
Parameters
message: TMessage
writer: Writer
Returns void
Returns Uint8Array