Definition at line 41 of file Binary.php.
◆ flipIntEndianness()
static pocketmine\utils\Binary::flipIntEndianness |
( |
int | $value | ) |
|
|
static |
◆ flipLongEndianness()
static pocketmine\utils\Binary::flipLongEndianness |
( |
int | $value | ) |
|
|
static |
◆ flipShortEndianness()
static pocketmine\utils\Binary::flipShortEndianness |
( |
int | $value | ) |
|
|
static |
◆ printFloat()
static pocketmine\utils\Binary::printFloat |
( |
float | $value | ) |
|
|
static |
Returns a printable floating-point number.
Definition at line 315 of file Binary.php.
◆ readBool()
static pocketmine\utils\Binary::readBool |
( |
string | $b | ) |
|
|
static |
◆ readByte()
static pocketmine\utils\Binary::readByte |
( |
string | $c | ) |
|
|
static |
Reads an unsigned byte (0 - 255)
- Exceptions
-
Definition at line 122 of file Binary.php.
◆ readDouble()
static pocketmine\utils\Binary::readDouble |
( |
string | $str | ) |
|
|
static |
Reads an 8-byte floating-point number.
- Exceptions
-
Definition at line 324 of file Binary.php.
◆ readFloat()
static pocketmine\utils\Binary::readFloat |
( |
string | $str | ) |
|
|
static |
Reads a 4-byte floating-point number
- Exceptions
-
Definition at line 267 of file Binary.php.
◆ readInt()
static pocketmine\utils\Binary::readInt |
( |
string | $str | ) |
|
|
static |
Reads a 4-byte signed integer
- Exceptions
-
Definition at line 235 of file Binary.php.
◆ readLDouble()
static pocketmine\utils\Binary::readLDouble |
( |
string | $str | ) |
|
|
static |
Reads an 8-byte little-endian floating-point number.
- Exceptions
-
Definition at line 340 of file Binary.php.
◆ readLFloat()
static pocketmine\utils\Binary::readLFloat |
( |
string | $str | ) |
|
|
static |
Reads a 4-byte little-endian floating-point number.
- Exceptions
-
Definition at line 292 of file Binary.php.
◆ readLInt()
static pocketmine\utils\Binary::readLInt |
( |
string | $str | ) |
|
|
static |
Reads a 4-byte signed little-endian integer
- Exceptions
-
Definition at line 251 of file Binary.php.
◆ readLLong()
static pocketmine\utils\Binary::readLLong |
( |
string | $str | ) |
|
|
static |
Reads an 8-byte little-endian integer.
- Exceptions
-
Definition at line 372 of file Binary.php.
◆ readLong()
static pocketmine\utils\Binary::readLong |
( |
string | $str | ) |
|
|
static |
Reads an 8-byte integer.
- Exceptions
-
Definition at line 356 of file Binary.php.
◆ readLShort()
static pocketmine\utils\Binary::readLShort |
( |
string | $str | ) |
|
|
static |
Reads a 16-bit unsigned little-endian number
- Exceptions
-
Definition at line 178 of file Binary.php.
◆ readLTriad()
static pocketmine\utils\Binary::readLTriad |
( |
string | $str | ) |
|
|
static |
Reads a 3-byte little-endian number
- Exceptions
-
Definition at line 219 of file Binary.php.
◆ readRoundedFloat()
static pocketmine\utils\Binary::readRoundedFloat |
( |
string | $str, |
|
|
int | $accuracy ) |
|
static |
Reads a 4-byte floating-point number, rounded to the specified number of decimal places.
- Exceptions
-
Definition at line 276 of file Binary.php.
◆ readRoundedLFloat()
static pocketmine\utils\Binary::readRoundedLFloat |
( |
string | $str, |
|
|
int | $accuracy ) |
|
static |
Reads a 4-byte little-endian floating-point number rounded to the specified number of decimal places.
- Exceptions
-
Definition at line 301 of file Binary.php.
◆ readShort()
static pocketmine\utils\Binary::readShort |
( |
string | $str | ) |
|
|
static |
Reads a 16-bit unsigned big-endian number
- Exceptions
-
Definition at line 153 of file Binary.php.
◆ readSignedByte()
static pocketmine\utils\Binary::readSignedByte |
( |
string | $c | ) |
|
|
static |
Reads a signed byte (-128 - 127)
- Exceptions
-
Definition at line 134 of file Binary.php.
◆ readSignedLShort()
static pocketmine\utils\Binary::readSignedLShort |
( |
string | $str | ) |
|
|
static |
Reads a 16-bit signed little-endian number
- Exceptions
-
Definition at line 187 of file Binary.php.
◆ readSignedShort()
static pocketmine\utils\Binary::readSignedShort |
( |
string | $str | ) |
|
|
static |
Reads a 16-bit signed big-endian number
- Exceptions
-
Definition at line 162 of file Binary.php.
◆ readTriad()
static pocketmine\utils\Binary::readTriad |
( |
string | $str | ) |
|
|
static |
Reads a 3-byte big-endian number
- Exceptions
-
Definition at line 203 of file Binary.php.
◆ readUnsignedVarInt()
static pocketmine\utils\Binary::readUnsignedVarInt |
( |
string | $buffer, |
|
|
int & | $offset ) |
|
static |
Reads a 32-bit variable-length unsigned integer.
- Parameters
-
int | $offset | reference parameter |
- Exceptions
-
BinaryDataException | if the var-int did not end after 5 bytes or there were not enough bytes |
Definition at line 403 of file Binary.php.
◆ readUnsignedVarLong()
static pocketmine\utils\Binary::readUnsignedVarLong |
( |
string | $buffer, |
|
|
int & | $offset ) |
|
static |
Reads a 64-bit unsigned variable-length integer.
- Parameters
-
int | $offset | reference parameter |
- Exceptions
-
BinaryDataException | if the var-int did not end after 10 bytes or there were not enough bytes |
Definition at line 470 of file Binary.php.
◆ readVarInt()
static pocketmine\utils\Binary::readVarInt |
( |
string | $buffer, |
|
|
int & | $offset ) |
|
static |
Reads a 32-bit zigzag-encoded variable-length integer.
- Parameters
-
int | $offset | reference parameter |
- Exceptions
-
Definition at line 390 of file Binary.php.
◆ readVarLong()
static pocketmine\utils\Binary::readVarLong |
( |
string | $buffer, |
|
|
int & | $offset ) |
|
static |
Reads a 64-bit zigzag-encoded variable-length integer.
- Parameters
-
int | $offset | reference parameter |
- Exceptions
-
Definition at line 457 of file Binary.php.
◆ signByte()
static pocketmine\utils\Binary::signByte |
( |
int | $value | ) |
|
|
static |
◆ signInt()
static pocketmine\utils\Binary::signInt |
( |
int | $value | ) |
|
|
static |
◆ signShort()
static pocketmine\utils\Binary::signShort |
( |
int | $value | ) |
|
|
static |
◆ unsignByte()
static pocketmine\utils\Binary::unsignByte |
( |
int | $value | ) |
|
|
static |
◆ unsignInt()
static pocketmine\utils\Binary::unsignInt |
( |
int | $value | ) |
|
|
static |
◆ unsignShort()
static pocketmine\utils\Binary::unsignShort |
( |
int | $value | ) |
|
|
static |
◆ writeBool()
static pocketmine\utils\Binary::writeBool |
( |
bool | $b | ) |
|
|
static |
◆ writeByte()
static pocketmine\utils\Binary::writeByte |
( |
int | $c | ) |
|
|
static |
Writes an unsigned/signed byte
Definition at line 144 of file Binary.php.
◆ writeDouble()
static pocketmine\utils\Binary::writeDouble |
( |
float | $value | ) |
|
|
static |
Writes an 8-byte floating-point number.
Definition at line 331 of file Binary.php.
◆ writeFloat()
static pocketmine\utils\Binary::writeFloat |
( |
float | $value | ) |
|
|
static |
Writes a 4-byte floating-point number.
Definition at line 283 of file Binary.php.
◆ writeInt()
static pocketmine\utils\Binary::writeInt |
( |
int | $value | ) |
|
|
static |
Writes a 4-byte integer
Definition at line 242 of file Binary.php.
◆ writeLDouble()
static pocketmine\utils\Binary::writeLDouble |
( |
float | $value | ) |
|
|
static |
Writes an 8-byte floating-point little-endian number.
Definition at line 347 of file Binary.php.
◆ writeLFloat()
static pocketmine\utils\Binary::writeLFloat |
( |
float | $value | ) |
|
|
static |
Writes a 4-byte little-endian floating-point number.
Definition at line 308 of file Binary.php.
◆ writeLInt()
static pocketmine\utils\Binary::writeLInt |
( |
int | $value | ) |
|
|
static |
Writes a 4-byte signed little-endian integer
Definition at line 258 of file Binary.php.
◆ writeLLong()
static pocketmine\utils\Binary::writeLLong |
( |
int | $value | ) |
|
|
static |
Writes an 8-byte little-endian integer.
Definition at line 379 of file Binary.php.
◆ writeLong()
static pocketmine\utils\Binary::writeLong |
( |
int | $value | ) |
|
|
static |
Writes an 8-byte integer.
Definition at line 363 of file Binary.php.
◆ writeLShort()
static pocketmine\utils\Binary::writeLShort |
( |
int | $value | ) |
|
|
static |
Writes a 16-bit signed/unsigned little-endian number
Definition at line 194 of file Binary.php.
◆ writeLTriad()
static pocketmine\utils\Binary::writeLTriad |
( |
int | $value | ) |
|
|
static |
Writes a 3-byte little-endian number
Definition at line 226 of file Binary.php.
◆ writeShort()
static pocketmine\utils\Binary::writeShort |
( |
int | $value | ) |
|
|
static |
Writes a 16-bit signed/unsigned big-endian number
Definition at line 169 of file Binary.php.
◆ writeTriad()
static pocketmine\utils\Binary::writeTriad |
( |
int | $value | ) |
|
|
static |
Writes a 3-byte big-endian number
Definition at line 210 of file Binary.php.
◆ writeUnsignedVarInt()
static pocketmine\utils\Binary::writeUnsignedVarInt |
( |
int | $value | ) |
|
|
static |
Writes a 32-bit unsigned integer as a variable-length integer.
- Returns
- string up to 5 bytes
Definition at line 433 of file Binary.php.
◆ writeUnsignedVarLong()
static pocketmine\utils\Binary::writeUnsignedVarLong |
( |
int | $value | ) |
|
|
static |
Writes a 64-bit unsigned integer as a variable-length long.
Definition at line 497 of file Binary.php.
◆ writeVarInt()
static pocketmine\utils\Binary::writeVarInt |
( |
int | $v | ) |
|
|
static |
Writes a 32-bit integer as a zigzag-encoded variable-length integer.
Definition at line 423 of file Binary.php.
◆ writeVarLong()
static pocketmine\utils\Binary::writeVarLong |
( |
int | $v | ) |
|
|
static |
Writes a 64-bit integer as a zigzag-encoded variable-length long.
Definition at line 490 of file Binary.php.
The documentation for this class was generated from the following file: