Table of Contents

Class BufferReader

Namespace
NArk.Core.Assets
Assembly
NArk.Core.dll

Binary deserialization helper using unsigned LEB128 varint encoding, matching the Go/TypeScript asset encoding implementations.

public class BufferReader
Inheritance
BufferReader
Inherited Members

Constructors

BufferReader(byte[])

public BufferReader(byte[] data)

Parameters

data byte[]

Properties

Remaining

public int Remaining { get; }

Property Value

int

Methods

ReadByte()

public byte ReadByte()

Returns

byte

ReadSlice(int)

public byte[] ReadSlice(int size)

Parameters

size int

Returns

byte[]

ReadUint16LE()

public ushort ReadUint16LE()

Returns

ushort

ReadVarInt()

Reads an unsigned LEB128 varint. Each byte stores 7 data bits; bit 7 is the continuation flag.

public ulong ReadVarInt()

Returns

ulong

ReadVarSlice()

public byte[] ReadVarSlice()

Returns

byte[]