Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/aether/deps.ts>Bson.deserializeStream

A Deno library to interface with the Discord API
Latest
function Bson.deserializeStream
import { Bson } from "https://deno.land/x/aether@v0.0.3/deps.ts";
const { deserializeStream } = Bson;

Deserialize stream data as BSON documents.

Parameters

data: Uint8Array | ArrayBufferView | ArrayBuffer
  • the buffer containing the serialized set of BSON documents.
startIndex: number
  • the start index in the data Buffer where the deserialization is to start.
numberOfDocuments: number
  • number of documents to deserialize.
documents: Document[]
  • an array where to store the deserialized documents.
docStartIndex: number
  • the index in the documents array from where to start inserting documents.
optional
options: DeserializeOptions
  • additional options used for the deserialization.

Returns

number

next index in the buffer after deserialization x numbers of documents.