import { Bson } from "https://deno.land/x/denodb@v1.1.0/deps.ts";
const { Binary } = Bson;
A class representation of the BSON Binary type.
Constructors
new
Binary(buffer?: string | BinarySequence, subType?: number)Methods
inspect(): string
length(): number
the length of the binary sequence
put(byteValue: ): void
| string
| number
| Uint8Array
| Buffer
| number[]
Updates this binary with byte_value.
read(position: number, length: number): BinarySequence
Reads length bytes starting at position.
toJSON(): string
toString(format?: string): string
value(asRaw?: boolean): string | BinarySequence
Returns the value of this binary as a string.
write(sequence: string | BinarySequence, offset: number): void
Writes a buffer or string to the binary.