Function unserializeFromBuffer

Unserialize data from a Buffer serialized with serializeToBuffer, useful when working with web sockets or other binary protocols. Make sure to understand how deserialize works before using this function.

  • Type Parameters

    • RT extends any[] = unknown[]

    Parameters

    • BufferImplementation: BufferConstructor

      Buffer implementation, in browsers use buffer npm package and import it from buffer/, in Node.js simply pass Buffer.

    • deserializeArgs: [customDeserializers?: CustomDeserializers, options?: DeserializeOptions]

      [customDeserializers, options] - optional arguments if you need to unserialize custom data types or configure the deserialization (see deserialize),

    • rawData: Buffer | Uint8Array

      Buffer to unserialize

    Returns RT

    unserialized data