Documentation

BaseNbtSerializer
in package
implements NbtStreamReader, NbtStreamWriter

Base Named Binary Tag encoder/decoder

Interfaces, Classes, Traits and Enums

NbtStreamReader
NbtStreamWriter

Table of Contents

$buffer  : BinaryStream
__construct()  : mixed
read()  : TreeRoot
Decodes NBT from the given binary string and returns it.
readByte()  : int
readByteArray()  : string
readMultiple()  : array<string|int, TreeRoot>
Decodes a list of NBT tags into objects and returns them.
readSignedByte()  : int
readString()  : string
write()  : string
writeByte()  : void
writeByteArray()  : void
writeMultiple()  : string
writeString()  : void
checkReadStringLength()  : int
checkWriteStringLength()  : int
readRoot()  : TreeRoot
writeRoot()  : void

Properties

Methods

read()

Decodes NBT from the given binary string and returns it.

public read(string $buffer[, int &$offset = 0 ][, int $maxDepth = 0 ]) : TreeRoot
Parameters
$buffer : string
$offset : int = 0

reference parameter

$maxDepth : int = 0
Tags
throws
NbtDataException
Return values
TreeRoot

readMultiple()

Decodes a list of NBT tags into objects and returns them.

public readMultiple(string $buffer[, int $maxDepth = 0 ]) : array<string|int, TreeRoot>

TODO: This is only necessary because we don't have a streams API worth mentioning. Get rid of this in the future.

Parameters
$buffer : string
$maxDepth : int = 0
Tags
throws
NbtDataException
Return values
array<string|int, TreeRoot>

writeByte()

public writeByte(int $v) : void
Parameters
$v : int
Return values
void

writeByteArray()

public writeByteArray(string $v) : void
Parameters
$v : string
Return values
void

writeString()

public writeString(string $v) : void
Parameters
$v : string
Tags
throws
InvalidArgumentException

if the string is too long

Return values
void

checkWriteStringLength()

protected static checkWriteStringLength(int $len) : int
Parameters
$len : int
Tags
throws
InvalidArgumentException
Return values
int

Search results