mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 23:59:53 +00:00
Merge branch 'master' into mcpe-1.2
This commit is contained in:
commit
899e318a88
@ -55,6 +55,20 @@ class Binary{
|
||||
return $value & 0xffffffff;
|
||||
}
|
||||
|
||||
|
||||
public static function flipShortEndianness(int $value) : int{
|
||||
return self::readLShort(self::writeShort($value));
|
||||
}
|
||||
|
||||
public static function flipIntEndianness(int $value) : int{
|
||||
return self::readLInt(self::writeInt($value));
|
||||
}
|
||||
|
||||
public static function flipLongEndianness(int $value) : int{
|
||||
return self::readLLong(self::writeLong($value));
|
||||
}
|
||||
|
||||
|
||||
private static function checkLength($str, $expect){
|
||||
assert(($len = strlen($str)) === $expect, "Expected $expect bytes, got $len");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user