Documentation

PacketSerializer extends BinaryStream
in package

Table of Contents

$buffer  : string
$offset  : int
__construct()  : mixed
feof()  : bool
Returns whether the offset has reached the end of the buffer.
get()  : string
getAddress()  : InternetAddress
getBool()  : bool
getBuffer()  : string
getByte()  : int
getDouble()  : float
getFloat()  : float
getInt()  : int
getLDouble()  : float
getLFloat()  : float
getLInt()  : int
getLLong()  : int
getLong()  : int
getLShort()  : int
getLTriad()  : int
getOffset()  : int
getRemaining()  : string
getRoundedFloat()  : float
getRoundedLFloat()  : float
getShort()  : int
getSignedLShort()  : int
getSignedShort()  : int
getString()  : string
getTriad()  : int
getUnsignedVarInt()  : int
Reads a 32-bit variable-length unsigned integer from the buffer and returns it.
getUnsignedVarLong()  : int
Reads a 64-bit variable-length integer from the buffer and returns it.
getVarInt()  : int
Reads a 32-bit zigzag-encoded variable-length integer from the buffer and returns it.
getVarLong()  : int
Reads a 64-bit zigzag-encoded variable-length integer from the buffer and returns it.
put()  : void
putAddress()  : void
putBool()  : void
putByte()  : void
putDouble()  : void
putFloat()  : void
putInt()  : void
putLDouble()  : void
putLFloat()  : void
putLInt()  : void
putLLong()  : void
putLong()  : void
putLShort()  : void
putLTriad()  : void
putShort()  : void
putString()  : void
putTriad()  : void
putUnsignedVarInt()  : void
Writes a 32-bit variable-length unsigned integer to the end of the buffer.
putUnsignedVarLong()  : void
Writes a 64-bit variable-length integer to the end of the buffer.
putVarInt()  : void
Writes a 32-bit zigzag-encoded variable-length integer to the end of the buffer.
putVarLong()  : void
Writes a 64-bit zigzag-encoded variable-length integer to the end of the buffer.
rewind()  : void
Rewinds the stream pointer to the start.
setOffset()  : void

Properties

Methods

__construct()

public __construct([string $buffer = "" ][, int $offset = 0 ]) : mixed
Parameters
$buffer : string = ""
$offset : int = 0
Return values
mixed

feof()

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

public feof() : bool
Return values
bool

get()

public get(int $len) : string
Parameters
$len : int
Tags
phpstan-impure
throws
BinaryDataException

if there are not enough bytes left in the buffer

Return values
string

getBuffer()

public getBuffer() : string
Return values
string

getOffset()

public getOffset() : int
Return values
int

getRoundedFloat()

public getRoundedFloat(int $accuracy) : float
Parameters
$accuracy : int
Tags
phpstan-impure
throws
BinaryDataException
Return values
float

getRoundedLFloat()

public getRoundedLFloat(int $accuracy) : float
Parameters
$accuracy : int
Tags
phpstan-impure
throws
BinaryDataException
Return values
float

getUnsignedVarInt()

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

public getUnsignedVarInt() : int
Tags
phpstan-impure
throws
BinaryDataException
Return values
int

getUnsignedVarLong()

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

public getUnsignedVarLong() : int
Tags
phpstan-impure
throws
BinaryDataException
Return values
int

getVarInt()

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

public getVarInt() : int
Tags
phpstan-impure
throws
BinaryDataException
Return values
int

getVarLong()

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

public getVarLong() : int
Tags
phpstan-impure
throws
BinaryDataException
Return values
int

put()

public put(string $str) : void
Parameters
$str : string
Return values
void

putBool()

public putBool(bool $v) : void
Parameters
$v : bool
Return values
void

putByte()

public putByte(int $v) : void
Parameters
$v : int
Return values
void

putDouble()

public putDouble(float $v) : void
Parameters
$v : float
Return values
void

putFloat()

public putFloat(float $v) : void
Parameters
$v : float
Return values
void

putInt()

public putInt(int $v) : void
Parameters
$v : int
Return values
void

putLDouble()

public putLDouble(float $v) : void
Parameters
$v : float
Return values
void

putLFloat()

public putLFloat(float $v) : void
Parameters
$v : float
Return values
void

putLInt()

public putLInt(int $v) : void
Parameters
$v : int
Return values
void

putLLong()

public putLLong(int $v) : void
Parameters
$v : int
Return values
void

putLong()

public putLong(int $v) : void
Parameters
$v : int
Return values
void

putLShort()

public putLShort(int $v) : void
Parameters
$v : int
Return values
void

putLTriad()

public putLTriad(int $v) : void
Parameters
$v : int
Return values
void

putShort()

public putShort(int $v) : void
Parameters
$v : int
Return values
void

putString()

public putString(string $v) : void
Parameters
$v : string
Return values
void

putTriad()

public putTriad(int $v) : void
Parameters
$v : int
Return values
void

putUnsignedVarInt()

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

public putUnsignedVarInt(int $v) : void
Parameters
$v : int
Return values
void

putUnsignedVarLong()

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

public putUnsignedVarLong(int $v) : void
Parameters
$v : int
Return values
void

putVarInt()

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

public putVarInt(int $v) : void
Parameters
$v : int
Return values
void

putVarLong()

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

public putVarLong(int $v) : void
Parameters
$v : int
Return values
void

rewind()

Rewinds the stream pointer to the start.

public rewind() : void
Return values
void

setOffset()

public setOffset(int $offset) : void
Parameters
$offset : int
Return values
void

Search results