PocketMine-MP 5.15.1 git-5ef247620a7c6301a849b54e5ef1009217729fc8
pocketmine\utils\BinaryStream Class Reference
+ Inheritance diagram for pocketmine\utils\BinaryStream:
+ Collaboration diagram for pocketmine\utils\BinaryStream:

Public Member Functions

 __construct (string $buffer="", int $offset=0)
 
 feof ()
 
 get (int $len)
 
 getBool ()
 
 getBuffer ()
 
 getByte ()
 
 getDouble ()
 
 getFloat ()
 
 getInt ()
 
 getLDouble ()
 
 getLFloat ()
 
 getLInt ()
 
 getLLong ()
 
 getLong ()
 
 getLShort ()
 
 getLTriad ()
 
 getOffset ()
 
 getRemaining ()
 
 getRoundedFloat (int $accuracy)
 
 getRoundedLFloat (int $accuracy)
 
 getShort ()
 
 getSignedLShort ()
 
 getSignedShort ()
 
 getTriad ()
 
 getUnsignedVarInt ()
 
 getUnsignedVarLong ()
 
 getVarInt ()
 
 getVarLong ()
 
 put (string $str)
 
 putBool (bool $v)
 
 putByte (int $v)
 
 putDouble (float $v)
 
 putFloat (float $v)
 
 putInt (int $v)
 
 putLDouble (float $v)
 
 putLFloat (float $v)
 
 putLInt (int $v)
 
 putLLong (int $v)
 
 putLong (int $v)
 
 putLShort (int $v)
 
 putLTriad (int $v)
 
 putShort (int $v)
 
 putTriad (int $v)
 
 putUnsignedVarInt (int $v)
 
 putUnsignedVarLong (int $v)
 
 putVarInt (int $v)
 
 putVarLong (int $v)
 
 rewind ()
 
 setOffset (int $offset)
 

Protected Attributes

 $buffer
 
 $offset
 

Detailed Description

Definition at line 31 of file BinaryStream.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\utils\BinaryStream::__construct ( string  $buffer = "",
int  $offset = 0 
)

Definition at line 39 of file BinaryStream.php.

Member Function Documentation

◆ feof()

pocketmine\utils\BinaryStream::feof ( )

Returns whether the offset has reached the end of the buffer.

Definition at line 372 of file BinaryStream.php.

◆ get()

pocketmine\utils\BinaryStream::get ( int  $len)

@phpstan-impure

Exceptions
BinaryDataExceptionif there are not enough bytes left in the buffer

Definition at line 67 of file BinaryStream.php.

Referenced by pocketmine\network\mcpe\protocol\serializer\PacketBatch\decodeRaw(), pocketmine\world\format\io\leveldb\LevelDB\deserializeBlockPalette(), and raklib\protocol\OfflineMessage\readMagic().

+ Here is the caller graph for this function:

◆ getBool()

pocketmine\utils\BinaryStream::getBool ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 105 of file BinaryStream.php.

Referenced by pocketmine\network\mcpe\protocol\CommandBlockUpdatePacket\decodePayload(), and pocketmine\network\mcpe\protocol\PlayerListPacket\decodePayload().

+ Here is the caller graph for this function:

◆ getBuffer()

pocketmine\utils\BinaryStream::getBuffer ( )

Definition at line 59 of file BinaryStream.php.

◆ getByte()

pocketmine\utils\BinaryStream::getByte ( )

◆ getDouble()

pocketmine\utils\BinaryStream::getDouble ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 257 of file BinaryStream.php.

◆ getFloat()

pocketmine\utils\BinaryStream::getFloat ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 217 of file BinaryStream.php.

◆ getInt()

pocketmine\utils\BinaryStream::getInt ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 193 of file BinaryStream.php.

◆ getLDouble()

pocketmine\utils\BinaryStream::getLDouble ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 269 of file BinaryStream.php.

◆ getLFloat()

pocketmine\utils\BinaryStream::getLFloat ( )

◆ getLInt()

pocketmine\utils\BinaryStream::getLInt ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 205 of file BinaryStream.php.

Referenced by pocketmine\network\mcpe\protocol\MovePlayerPacket\decodePayload(), pocketmine\network\mcpe\protocol\PlayerListPacket\decodePayload(), and pocketmine\network\mcpe\protocol\SetScorePacket\decodePayload().

+ Here is the caller graph for this function:

◆ getLLong()

pocketmine\utils\BinaryStream::getLLong ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 293 of file BinaryStream.php.

Referenced by pocketmine\network\mcpe\protocol\ClientboundDebugRendererPacket\decodePayload(), pocketmine\network\mcpe\protocol\ClientCacheBlobStatusPacket\decodePayload(), and pocketmine\network\mcpe\protocol\ClientCacheMissResponsePacket\decodePayload().

+ Here is the caller graph for this function:

◆ getLong()

pocketmine\utils\BinaryStream::getLong ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 281 of file BinaryStream.php.

◆ getLShort()

pocketmine\utils\BinaryStream::getLShort ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 149 of file BinaryStream.php.

Referenced by pocketmine\network\mcpe\protocol\BossEventPacket\decodePayload(), and pocketmine\network\mcpe\protocol\AvailableCommandsPacket\getCommandData().

+ Here is the caller graph for this function:

◆ getLTriad()

pocketmine\utils\BinaryStream::getLTriad ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 181 of file BinaryStream.php.

Referenced by raklib\protocol\AcknowledgePacket\decodePayload().

+ Here is the caller graph for this function:

◆ getOffset()

pocketmine\utils\BinaryStream::getOffset ( )

Definition at line 55 of file BinaryStream.php.

◆ getRemaining()

pocketmine\utils\BinaryStream::getRemaining ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 87 of file BinaryStream.php.

◆ getRoundedFloat()

pocketmine\utils\BinaryStream::getRoundedFloat ( int  $accuracy)

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 225 of file BinaryStream.php.

◆ getRoundedLFloat()

pocketmine\utils\BinaryStream::getRoundedLFloat ( int  $accuracy)

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 245 of file BinaryStream.php.

◆ getShort()

pocketmine\utils\BinaryStream::getShort ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 129 of file BinaryStream.php.

◆ getSignedLShort()

pocketmine\utils\BinaryStream::getSignedLShort ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 157 of file BinaryStream.php.

◆ getSignedShort()

pocketmine\utils\BinaryStream::getSignedShort ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 137 of file BinaryStream.php.

◆ getTriad()

pocketmine\utils\BinaryStream::getTriad ( )

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 169 of file BinaryStream.php.

◆ getUnsignedVarInt()

pocketmine\utils\BinaryStream::getUnsignedVarInt ( )

◆ getUnsignedVarLong()

pocketmine\utils\BinaryStream::getUnsignedVarLong ( )

Reads a 64-bit variable-length integer from the buffer and returns it.

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 341 of file BinaryStream.php.

◆ getVarInt()

pocketmine\utils\BinaryStream::getVarInt ( )

Reads a 32-bit zigzag-encoded variable-length integer from the buffer and returns it.

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 324 of file BinaryStream.php.

Referenced by pocketmine\network\mcpe\protocol\CraftingDataPacket\decodePayload(), and pocketmine\network\mcpe\protocol\types\inventory\NetworkInventoryAction\read().

+ Here is the caller graph for this function:

◆ getVarLong()

pocketmine\utils\BinaryStream::getVarLong ( )

Reads a 64-bit zigzag-encoded variable-length integer from the buffer and returns it.

@phpstan-impure

Exceptions
BinaryDataException

Definition at line 358 of file BinaryStream.php.

Referenced by pocketmine\network\mcpe\protocol\SetScoreboardIdentityPacket\decodePayload(), and pocketmine\network\mcpe\protocol\SetScorePacket\decodePayload().

+ Here is the caller graph for this function:

◆ put()

pocketmine\utils\BinaryStream::put ( string  $str)

Definition at line 97 of file BinaryStream.php.

◆ putBool()

pocketmine\utils\BinaryStream::putBool ( bool  $v)

Definition at line 109 of file BinaryStream.php.

◆ putByte()

pocketmine\utils\BinaryStream::putByte ( int  $v)

Definition at line 121 of file BinaryStream.php.

◆ putDouble()

pocketmine\utils\BinaryStream::putDouble ( float  $v)

Definition at line 261 of file BinaryStream.php.

◆ putFloat()

pocketmine\utils\BinaryStream::putFloat ( float  $v)

Definition at line 229 of file BinaryStream.php.

◆ putInt()

pocketmine\utils\BinaryStream::putInt ( int  $v)

Definition at line 197 of file BinaryStream.php.

◆ putLDouble()

pocketmine\utils\BinaryStream::putLDouble ( float  $v)

Definition at line 273 of file BinaryStream.php.

◆ putLFloat()

pocketmine\utils\BinaryStream::putLFloat ( float  $v)

Definition at line 249 of file BinaryStream.php.

◆ putLInt()

pocketmine\utils\BinaryStream::putLInt ( int  $v)

Definition at line 209 of file BinaryStream.php.

◆ putLLong()

pocketmine\utils\BinaryStream::putLLong ( int  $v)

Definition at line 297 of file BinaryStream.php.

◆ putLong()

pocketmine\utils\BinaryStream::putLong ( int  $v)

Definition at line 285 of file BinaryStream.php.

◆ putLShort()

pocketmine\utils\BinaryStream::putLShort ( int  $v)

Definition at line 161 of file BinaryStream.php.

◆ putLTriad()

pocketmine\utils\BinaryStream::putLTriad ( int  $v)

Definition at line 185 of file BinaryStream.php.

◆ putShort()

pocketmine\utils\BinaryStream::putShort ( int  $v)

Definition at line 141 of file BinaryStream.php.

◆ putTriad()

pocketmine\utils\BinaryStream::putTriad ( int  $v)

Definition at line 173 of file BinaryStream.php.

◆ putUnsignedVarInt()

◆ putUnsignedVarLong()

pocketmine\utils\BinaryStream::putUnsignedVarLong ( int  $v)

Writes a 64-bit variable-length integer to the end of the buffer.

Definition at line 348 of file BinaryStream.php.

◆ putVarInt()

pocketmine\utils\BinaryStream::putVarInt ( int  $v)

Writes a 32-bit zigzag-encoded variable-length integer to the end of the buffer.

Definition at line 331 of file BinaryStream.php.

Referenced by pocketmine\network\mcpe\protocol\CraftingDataPacket\encodePayload(), and pocketmine\network\mcpe\protocol\types\inventory\NetworkInventoryAction\write().

+ Here is the caller graph for this function:

◆ putVarLong()

pocketmine\utils\BinaryStream::putVarLong ( int  $v)

Writes a 64-bit zigzag-encoded variable-length integer to the end of the buffer.

Definition at line 365 of file BinaryStream.php.

Referenced by pocketmine\network\mcpe\protocol\SetScoreboardIdentityPacket\encodePayload(), and pocketmine\network\mcpe\protocol\SetScorePacket\encodePayload().

+ Here is the caller graph for this function:

◆ rewind()

pocketmine\utils\BinaryStream::rewind ( )

Rewinds the stream pointer to the start.

Definition at line 47 of file BinaryStream.php.

◆ setOffset()

pocketmine\utils\BinaryStream::setOffset ( int  $offset)

Definition at line 51 of file BinaryStream.php.

Member Data Documentation

◆ $buffer

pocketmine\utils\BinaryStream::$buffer
protected

Definition at line 37 of file BinaryStream.php.

◆ $offset

pocketmine\utils\BinaryStream::$offset
protected

Definition at line 35 of file BinaryStream.php.


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