Skip to main content
Module

x/steam_trader/types/protobuf.d.ts>Writer

https://deno.land/x/steam_trader
Latest
class Writer
import { Writer } from "https://deno.land/x/steam_trader@v0.4.0/types/protobuf.d.ts";

Wire format writer using Uint8Array if available, otherwise Array.

Constructors

new
Writer()

Constructs a new writer instance.

Properties

head: object

Operations head.

len: number

Current length.

states: (object | null)

Linked forked states.

tail: object

Operations tail

Methods

bool(value: boolean): Writer

Writes a boolish value as a varint.

bytes(value: (Uint8Array | string)): Writer

Writes a sequence of bytes.

double(value: number): Writer

Writes a double (64 bit float).

finish(): Uint8Array

Finishes the write operation.

fixed32(value: number): Writer

Writes an unsigned 32 bit value as fixed 32 bits.

fixed64(value: (Long | number | string)): Writer

Writes an unsigned 64 bit value as fixed 64 bits.

float(value: number): Writer

Writes a float (32 bit).

Forks this writer's state by pushing it to a stack. Calling Writer#reset | reset or Writer#ldelim | ldelim resets the writer to the previous state.

int32(value: number): Writer

Writes a signed 32 bit value as a varint.

int64(value: (Long | number | string)): Writer

Writes a signed 64 bit value as a varint.

Resets to the last state and appends the fork state's current write length as a varint followed by its operations.

Resets this instance to the last state.

sfixed32(value: number): Writer

Writes a signed 32 bit value as fixed 32 bits.

sfixed64(value: (Long | number | string)): Writer

Writes a signed 64 bit value as fixed 64 bits.

sint32(value: number): Writer

Writes a 32 bit value as a varint, zig-zag encoded.

sint64(value: (Long | number | string)): Writer

Writes a signed 64 bit value as a varint, zig-zag encoded.

string(value: string): Writer

Writes a string.

uint32(value: number): Writer

Writes an unsigned 32 bit value as a varint.

uint64(value: (Long | number | string)): Writer

Writes an unsigned 64 bit value as a varint.

Static Methods

alloc(size: number): Uint8Array

Allocates a buffer of the specified size.

Creates a new writer.