PocketMine-MP 5.17.1 git-df4ada81e5d74a14046f27cf44a37dcee69d657e
pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer Class Reference
+ Inheritance diagram for pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer:
+ Collaboration diagram for pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer:

Public Member Functions

 read (string $buffer, int &$offset=0, int $maxDepth=0)
 
 readByte ()
 
 readByteArray ()
 
 readDouble ()
 
 readFloat ()
 
 readHeadless (string $buffer, int $rootType, int &$offset=0, int $maxDepth=0)
 
 readInt ()
 
 readIntArray ()
 
 readLong ()
 
 readMultiple (string $buffer, int $maxDepth=0)
 
 readShort ()
 
 readSignedByte ()
 
 readSignedShort ()
 
 readString ()
 
 write (TreeRoot $data)
 
 writeByte (int $v)
 
 writeByteArray (string $v)
 
 writeDouble (float $v)
 
 writeFloat (float $v)
 
 writeHeadless (Tag $data)
 
 writeInt (int $v)
 
 writeIntArray (array $array)
 
 writeLong (int $v)
 
 writeMultiple (array $data)
 
 writeShort (int $v)
 
 writeString (string $v)
 

Static Protected Member Functions

static checkReadStringLength (int $len)
 
static checkWriteStringLength (int $len)
 

Protected Attributes

 $buffer
 

Detailed Description

Definition at line 22 of file NetworkNbtSerializer.php.

Member Function Documentation

◆ checkReadStringLength()

static pocketmine\nbt\BaseNbtSerializer::checkReadStringLength ( int  $len)
staticprotectedinherited
Exceptions
NbtDataException

Definition at line 185 of file BaseNbtSerializer.php.

◆ checkWriteStringLength()

static pocketmine\nbt\BaseNbtSerializer::checkWriteStringLength ( int  $len)
staticprotectedinherited
Exceptions

InvalidArgumentException

Definition at line 195 of file BaseNbtSerializer.php.

◆ read()

pocketmine\nbt\BaseNbtSerializer::read ( string  $buffer,
int &  $offset = 0,
int  $maxDepth = 0 
)
inherited

Decodes NBT from the given binary string and returns it.

Parameters
int$offsetreference parameter
Exceptions
NbtDataException

Definition at line 64 of file BaseNbtSerializer.php.

◆ readByte()

pocketmine\nbt\BaseNbtSerializer::readByte ( )
inherited
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 157 of file BaseNbtSerializer.php.

◆ readByteArray()

pocketmine\nbt\BaseNbtSerializer::readByteArray ( )
inherited
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 169 of file BaseNbtSerializer.php.

◆ readDouble()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::readDouble ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 69 of file NetworkNbtSerializer.php.

◆ readFloat()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::readFloat ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 61 of file NetworkNbtSerializer.php.

◆ readHeadless()

pocketmine\nbt\BaseNbtSerializer::readHeadless ( string  $buffer,
int  $rootType,
int &  $offset = 0,
int  $maxDepth = 0 
)
inherited

Reads a tag without a header from the buffer and returns it. The tag does not have a name, and the type is not specified by the binary data. Only the tag's raw binary value is present. This could be used if the expected root type is always the same.

This format is not usually seen in the wild, but it is used in some places in the Minecraft: Bedrock network protocol.

Exceptions
NbtDataException

Definition at line 87 of file BaseNbtSerializer.php.

◆ readInt()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::readInt ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 36 of file NetworkNbtSerializer.php.

◆ readIntArray()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::readIntArray ( )
Returns
int[]
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 77 of file NetworkNbtSerializer.php.

◆ readLong()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::readLong ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 44 of file NetworkNbtSerializer.php.

◆ readMultiple()

pocketmine\nbt\BaseNbtSerializer::readMultiple ( string  $buffer,
int  $maxDepth = 0 
)
inherited

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

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

Returns
TreeRoot[]
Exceptions
NbtDataException

Definition at line 104 of file BaseNbtSerializer.php.

◆ readShort()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::readShort ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 24 of file NetworkNbtSerializer.php.

◆ readSignedByte()

pocketmine\nbt\BaseNbtSerializer::readSignedByte ( )
inherited
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 161 of file BaseNbtSerializer.php.

◆ readSignedShort()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::readSignedShort ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 28 of file NetworkNbtSerializer.php.

◆ readString()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::readString ( )
Exceptions
BinaryDataException

Reimplemented from pocketmine\nbt\BaseNbtSerializer.

Definition at line 52 of file NetworkNbtSerializer.php.

◆ write()

pocketmine\nbt\BaseNbtSerializer::write ( TreeRoot  $data)
inherited

Definition at line 126 of file BaseNbtSerializer.php.

◆ writeByte()

pocketmine\nbt\BaseNbtSerializer::writeByte ( int  $v)
inherited

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 165 of file BaseNbtSerializer.php.

◆ writeByteArray()

pocketmine\nbt\BaseNbtSerializer::writeByteArray ( string  $v)
inherited

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 177 of file BaseNbtSerializer.php.

◆ writeDouble()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::writeDouble ( float  $v)

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 73 of file NetworkNbtSerializer.php.

◆ writeFloat()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::writeFloat ( float  $v)

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 65 of file NetworkNbtSerializer.php.

◆ writeHeadless()

pocketmine\nbt\BaseNbtSerializer::writeHeadless ( Tag  $data)
inherited

Writes a nameless tag without any header information. The reader of the data must know what type to expect, as it is not specified in the data.

See also
BaseNbtSerializer::readHeadless()

Definition at line 140 of file BaseNbtSerializer.php.

◆ writeInt()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::writeInt ( int  $v)

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 40 of file NetworkNbtSerializer.php.

◆ writeIntArray()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::writeIntArray ( array  $array)
Parameters
int[]$array

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 90 of file NetworkNbtSerializer.php.

◆ writeLong()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::writeLong ( int  $v)

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 48 of file NetworkNbtSerializer.php.

◆ writeMultiple()

pocketmine\nbt\BaseNbtSerializer::writeMultiple ( array  $data)
inherited
Parameters
TreeRoot[]$data

Definition at line 149 of file BaseNbtSerializer.php.

◆ writeShort()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::writeShort ( int  $v)

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 32 of file NetworkNbtSerializer.php.

◆ writeString()

pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer::writeString ( string  $v)
Exceptions

InvalidArgumentException if the string is too long

Reimplemented from pocketmine\nbt\BaseNbtSerializer.

Definition at line 56 of file NetworkNbtSerializer.php.

Member Data Documentation

◆ $buffer

pocketmine\nbt\BaseNbtSerializer::$buffer
protectedinherited

Definition at line 37 of file BaseNbtSerializer.php.


The documentation for this class was generated from the following file: