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

x/fkm_nbt/utils/BinaryWriter.ts>default

Node: https://www.npmjs.com/package/fkm-nbt Deno: https://deno.land/x/fkm_nbt
Latest
class default
import { default } from "https://deno.land/x/fkm_nbt@v0.1.0/utils/BinaryWriter.ts";

Constructors

new
default(buffer?: Uint8Array)

Properties

private
buffer: Uint8Array
private
cursor: number
private
optional
littleEndian: boolean
private
textEncoder: TextEncoder
private
view: DataView

Methods

private
ensureCapacity(size: number): void
private
writeStringStorage(length: number, type:
| "int16"
| "uint16"
| "int32"
| "uint32"
): void
drop(): void
flush(): Uint8Array
getOffset(): number
setOffset(offset: number): void
useLittleEndian(little: boolean): void
write(value: number[]): void
writeBuffer(value: Uint8Array): void
writeByte(value: number): void
writeBytes(value: number[]): void
writeDouble(value: number, littleEndian?: boolean): void
writeFloat(value: number, littleEndian?: boolean): void
writeFloat32BE(value: number): void
writeFloat32LE(value: number): void
writeFloat64BE(value: number): void
writeFloat64LE(value: number): void
writeInt(value: number, littleEndian?: boolean): void
writeInt16BE(value: number): void
writeInt16LE(value: number): void
writeInt32BE(value: number): void
writeInt32LE(value: number): void
writeInt64BE(value: bigint): void
writeInt64LE(value: bigint): void
writeInt8(value: number): void
writeLong(value: bigint, littleEndian?: boolean): void
writeShort(value: number, littleEndian?: boolean): void
writeString(value: string, storage?:
| "int16"
| "uint16"
| "int32"
| "uint32"
): void
writeUByte(value: number): void
writeUCS2(value: string, storage?:
| "int16"
| "uint16"
| "int32"
| "uint32"
): void
writeUInt(value: number, littleEndian?: boolean): void
writeUInt16BE(value: number): void
writeUInt16LE(value: number): void
writeUInt32BE(value: number): void
writeUInt32LE(value: number): void
writeUInt64BE(value: bigint): void
writeUInt64LE(value: bigint): void
writeUInt8(value: number): void
writeULong(value: bigint, littleEndian?: boolean): void
writeUShort(value: number, littleEndian?: boolean): void
writeUTF8(value: string, storage?:
| "int16"
| "uint16"
| "int32"
| "uint32"
): void
writeVarInt(value: number): void