VarInt

object VarInt

Variable-length integer encoding used by the Hytale protocol.

Functions

Link copied to clipboard
fun length(buf: ByteBuf, index: Int): Int

Returns VarInt byte length at index, or -1 if incomplete.

Link copied to clipboard
fun peek(buf: ByteBuf, index: Int): Int

Peeks a VarInt value at index without changing reader index.

Link copied to clipboard
fun read(buf: ByteBuf): Int

Reads a VarInt from buf.

Link copied to clipboard
fun size(value: Int): Int

Computes encoded size for value.

Link copied to clipboard
fun write(buf: ByteBuf, value: Int)

Writes value as a VarInt into buf.