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

x/bencodex/src/encoder.ts>EncodingState

An alternative take on implementing Bencodex in TypeScript/JavaScript
Latest
interface EncodingState
import { type EncodingState } from "https://deno.land/x/bencodex@0.2.2/src/encoder.ts";

Represents the end state of encoding.

Properties

readonly
written: number

The number of bytes written into the buffer.

readonly
complete: boolean

Whether the encoding is complete.

If true, the encoding is complete and the buffer is filled with the encoded value.

If false, the encoding is not complete and the buffer is filled with the encoded value as much as possible. In this case, you should call encodeInto again with the same value and a new larger buffer.