PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
pocketmine\nbt\BigEndianNbtSerializer Class Reference
+ Inheritance diagram for pocketmine\nbt\BigEndianNbtSerializer:
+ Collaboration diagram for pocketmine\nbt\BigEndianNbtSerializer:

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 32 of file BigEndianNbtSerializer.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\nbt\BigEndianNbtSerializer::readDouble ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 70 of file BigEndianNbtSerializer.php.

◆ readFloat()

pocketmine\nbt\BigEndianNbtSerializer::readFloat ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 62 of file BigEndianNbtSerializer.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\nbt\BigEndianNbtSerializer::readInt ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 46 of file BigEndianNbtSerializer.php.

◆ readIntArray()

pocketmine\nbt\BigEndianNbtSerializer::readIntArray ( )
Returns
int[]
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 78 of file BigEndianNbtSerializer.php.

◆ readLong()

pocketmine\nbt\BigEndianNbtSerializer::readLong ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 54 of file BigEndianNbtSerializer.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\nbt\BigEndianNbtSerializer::readShort ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 34 of file BigEndianNbtSerializer.php.

◆ readSignedByte()

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

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 161 of file BaseNbtSerializer.php.

◆ readSignedShort()

pocketmine\nbt\BigEndianNbtSerializer::readSignedShort ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 38 of file BigEndianNbtSerializer.php.

◆ readString()

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

Implements pocketmine\nbt\NbtStreamReader.

Reimplemented in pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer.

Definition at line 202 of file BaseNbtSerializer.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\nbt\BigEndianNbtSerializer::writeDouble ( float $v)

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 74 of file BigEndianNbtSerializer.php.

◆ writeFloat()

pocketmine\nbt\BigEndianNbtSerializer::writeFloat ( float $v)

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 66 of file BigEndianNbtSerializer.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\nbt\BigEndianNbtSerializer::writeInt ( int $v)

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 50 of file BigEndianNbtSerializer.php.

◆ writeIntArray()

pocketmine\nbt\BigEndianNbtSerializer::writeIntArray ( array $array)
Parameters
int[]$array

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 88 of file BigEndianNbtSerializer.php.

◆ writeLong()

pocketmine\nbt\BigEndianNbtSerializer::writeLong ( int $v)

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 58 of file BigEndianNbtSerializer.php.

◆ writeMultiple()

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

Definition at line 149 of file BaseNbtSerializer.php.

◆ writeShort()

pocketmine\nbt\BigEndianNbtSerializer::writeShort ( int $v)

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 42 of file BigEndianNbtSerializer.php.

◆ writeString()

pocketmine\nbt\BaseNbtSerializer::writeString ( string $v)
inherited
Exceptions

InvalidArgumentException if the string is too long

Implements pocketmine\nbt\NbtStreamWriter.

Reimplemented in pocketmine\network\mcpe\protocol\serializer\NetworkNbtSerializer.

Definition at line 209 of file BaseNbtSerializer.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: