DiscordPHP Documentation

Buffer extends Buffer
in package
implements ArrayAccess

A Byte Buffer similar to Buffer in NodeJS.

Tags
since
3.2.0

Interfaces, Classes, Traits and Enums

ArrayAccess

Table of Contents

offsetExists()  : bool
Checks if an attribute exists via key. Used for ArrayAccess.
offsetGet()  : mixed
Gets an attribute via key. Used for ArrayAccess.
offsetSet()  : void
Sets an attribute via key. Used for ArrayAccess.
offsetUnset()  : void
Unsets an attribute via key. Used for ArrayAccess.
readInt()  : int
Reads a signed integer.
readShort()  : int
Reads an unsigned big endian short.
readUIntLE()  : int
Reads a unsigned integer with little endian.
writeChar()  : void
Writes a char.
writeInt()  : void
Writes a signed integer.
writeRaw()  : void
Writes raw binary to the buffer.
writeRawString()  : void
Writes a binary string to the buffer.
writeShort()  : void
Writes an unsigned big endian short.
writeUInt32BE()  : void
Writes a 32-bit unsigned integer with big endian.
writeUInt64LE()  : void
Writes a 64-bit unsigned integer with little endian.

Methods

offsetExists()

Checks if an attribute exists via key. Used for ArrayAccess.

public offsetExists(mixed $key) : bool
Parameters
$key : mixed

The attribute key.

Return values
bool

Whether the offset exists.

offsetGet()

Gets an attribute via key. Used for ArrayAccess.

public offsetGet(mixed $key) : mixed
Parameters
$key : mixed

The attribute key.

Return values
mixed

offsetSet()

Sets an attribute via key. Used for ArrayAccess.

public offsetSet(mixed $key, mixed $value) : void
Parameters
$key : mixed

The attribute key.

$value : mixed

The attribute value.

Return values
void

offsetUnset()

Unsets an attribute via key. Used for ArrayAccess.

public offsetUnset(string $key) : void
Parameters
$key : string

The attribute key.

Return values
void

readInt()

Reads a signed integer.

public readInt(int $offset) : int
Parameters
$offset : int

The offset to read from.

Return values
int

The data read.

readShort()

Reads an unsigned big endian short.

public readShort(int $offset) : int
Parameters
$offset : int

The offset to read from.

Return values
int

The data read.

readUIntLE()

Reads a unsigned integer with little endian.

public readUIntLE(int $offset) : int
Parameters
$offset : int

The offset that will be read.

Return values
int

The value that is at the specified offset.

writeChar()

Writes a char.

public writeChar(string $value, int $offset) : void
Parameters
$value : string

The value that will be written.

$offset : int

The offset that the value will be written.

Return values
void

writeInt()

Writes a signed integer.

public writeInt(int $value, int $offset) : void
Parameters
$value : int

The value that will be written.

$offset : int

The offset that the value will be written.

Return values
void

writeRaw()

Writes raw binary to the buffer.

public writeRaw(int $value, int $offset) : void
Parameters
$value : int

The value that will be written.

$offset : int

The offset that the value will be written at.

Return values
void

writeRawString()

Writes a binary string to the buffer.

public writeRawString(string $value, int $offset) : void
Parameters
$value : string

The value that will be written.

$offset : int

The offset that the value will be written at.

Return values
void

writeShort()

Writes an unsigned big endian short.

public writeShort(int $value, int $offset) : void
Parameters
$value : int

The value that will be written.

$offset : int

The offset that the value will be written.

Return values
void

writeUInt32BE()

Writes a 32-bit unsigned integer with big endian.

public writeUInt32BE(int $value, int $offset) : void
Parameters
$value : int

The value that will be written.

$offset : int

The offset that the value will be written.

Return values
void

writeUInt64LE()

Writes a 64-bit unsigned integer with little endian.

public writeUInt64LE(int $value, int $offset) : void
Parameters
$value : int

The value that will be written.

$offset : int

The offset that the value will be written.

Return values
void

Search results