Latest
class Encoder
import { Encoder } from "https://dotland.deno.dev/x/kafkasaur@v0.0.7/src/protocol/encoder.ts";

Constructors

new
Encoder(initialSize?)

Construct a new encoder with the given initial size

Properties

buf: Buffer
readonly
buffer
offset: number

Methods

ensureAvailable(length: number)
writeArray(
array: any[],
type?: number | string | Record<string, unknown>,
length?: number,
)
writeBoolean(value: boolean)
writeBytes(value:
| string
| ArrayBufferView
| ArrayBuffer
| SharedArrayBuffer
| null
)
writeDouble(value: number)
writeInt16(value: number)
writeInt32(value: number)
writeInt64(value: number)
writeInt8(value: number)
writeNullableArray(array: [], type?: number | string | Record<string, unknown>)
writeString(value: string)
writeUInt32(value: number)
writeUVarInt(value: any)
writeUVarIntArray(array: any[], type: number | string | Record<string, unknown>)
writeUVarIntBytes(value:
| string
| ArrayBufferView
| ArrayBuffer
| SharedArrayBuffer
)
writeUVarIntString(value: string)
writeVarInt(value: any)
writeVarIntArray(array: any[], type: number | string | Record<string, unknown>)
writeVarIntBytes(value:
| string
| ArrayBufferView
| ArrayBuffer
| SharedArrayBuffer
)
writeVarIntString(value: string)
writeVarLong(value: any)

Static Methods

encodeZigZag(value: number)
encodeZigZag64(value: number)
nextPowerOfTwo(value: number)
sizeOfVarInt(value: number)
sizeOfVarIntBytes(value:
| string
| ArrayBufferView
| ArrayBuffer
| SharedArrayBuffer
)
sizeOfVarLong(value: number)