PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
pocketmine\nbt\LittleEndianNbtSerializer Class Reference
+ Inheritance diagram for pocketmine\nbt\LittleEndianNbtSerializer:
+ Collaboration diagram for pocketmine\nbt\LittleEndianNbtSerializer:

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 LittleEndianNbtSerializer.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\LittleEndianNbtSerializer::readDouble ( )
Exceptions
BinaryDataException

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 70 of file LittleEndianNbtSerializer.php.

◆ readFloat()

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

Implements pocketmine\nbt\NbtStreamReader.

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

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 46 of file LittleEndianNbtSerializer.php.

◆ readIntArray()

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

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 78 of file LittleEndianNbtSerializer.php.

◆ readLong()

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

Implements pocketmine\nbt\NbtStreamReader.

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

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 34 of file LittleEndianNbtSerializer.php.

◆ readSignedByte()

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

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 161 of file BaseNbtSerializer.php.

◆ readSignedShort()

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

Implements pocketmine\nbt\NbtStreamReader.

Definition at line 38 of file LittleEndianNbtSerializer.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\LittleEndianNbtSerializer::writeDouble ( float $v)

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 74 of file LittleEndianNbtSerializer.php.

◆ writeFloat()

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

Implements pocketmine\nbt\NbtStreamWriter.

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

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 50 of file LittleEndianNbtSerializer.php.

◆ writeIntArray()

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

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 88 of file LittleEndianNbtSerializer.php.

◆ writeLong()

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

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 58 of file LittleEndianNbtSerializer.php.

◆ writeMultiple()

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

Definition at line 149 of file BaseNbtSerializer.php.

◆ writeShort()

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

Implements pocketmine\nbt\NbtStreamWriter.

Definition at line 42 of file LittleEndianNbtSerializer.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: