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
$buffer
protected
BinaryStream
$buffer
Methods
__construct()
public
__construct() : mixed
Return values
mixed —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
Return values
TreeRoot —readByte()
public
readByte() : int
Return values
int —readByteArray()
public
readByteArray() : string
Return values
string —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
Return values
array<string|int, TreeRoot> —readSignedByte()
public
readSignedByte() : int
Return values
int —readString()
public
readString() : string
Return values
string —write()
public
write(TreeRoot $data) : string
Parameters
- $data : TreeRoot
Return values
string —writeByte()
public
writeByte(int $v) : void
Parameters
- $v : int
Return values
void —writeByteArray()
public
writeByteArray(string $v) : void
Parameters
- $v : string
Return values
void —writeMultiple()
public
writeMultiple(array<string|int, TreeRoot> $data) : string
Parameters
- $data : array<string|int, TreeRoot>
Return values
string —writeString()
public
writeString(string $v) : void
Parameters
- $v : string
Tags
Return values
void —checkReadStringLength()
protected
static checkReadStringLength(int $len) : int
Parameters
- $len : int
Tags
Return values
int —checkWriteStringLength()
protected
static checkWriteStringLength(int $len) : int
Parameters
- $len : int
Tags
Return values
int —readRoot()
private
readRoot(int $maxDepth) : TreeRoot
Parameters
- $maxDepth : int
Tags
Return values
TreeRoot —writeRoot()
private
writeRoot(TreeRoot $root) : void
Parameters
- $root : TreeRoot