Documentation

BigEndianNbtSerializer extends BaseNbtSerializer
in package

Base Named Binary Tag encoder/decoder

Table of Contents

$buffer  : BinaryStream
__construct()  : mixed
read()  : TreeRoot
Decodes NBT from the given binary string and returns it.
readByte()  : int
readByteArray()  : string
readDouble()  : float
readFloat()  : float
readInt()  : int
readIntArray()  : array<string|int, mixed>
readLong()  : int
readMultiple()  : array<string|int, TreeRoot>
Decodes a list of NBT tags into objects and returns them.
readShort()  : int
readSignedByte()  : int
readSignedShort()  : int
readString()  : string
write()  : string
writeByte()  : void
writeByteArray()  : void
writeDouble()  : void
writeFloat()  : void
writeInt()  : void
writeIntArray()  : void
writeLong()  : void
writeMultiple()  : string
writeShort()  : void
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

readIntArray()

public readIntArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

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

writeIntArray()

public writeIntArray(array<string|int, mixed> $array) : void
Parameters
$array : array<string|int, mixed>
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