php-amqplib

AMQPReader extends AMQPByteStream
in package

Table of Contents

BIT  = 1
LONG  = 4
LONGLONG  = 8
OCTET  = 1
READ_PHP_INT  = 4
SHORT  = 2
SHORTSTR  = 1
SIGNED_LONG  = 4
TIMESTAMP  = 8
PLATFORM_64BIT  = PHP_INT_SIZE === 8
$bigIntegers  : array<string|int, array<string|int, BigInteger>>
$bitcount  : int
$bits  : int
$isLittleEndian  : bool
$offset  : int
close()  : void
Close the byte stream.
read()  : string
read_array()  : array<string|int, mixed>|AMQPArray
Reads the array in the next value.
read_array_object()  : array<string|int, mixed>|AMQPArray
read_bit()  : bool
read_double()  : float
read_float()  : float
read_long()  : int|string
PHP does not have unsigned 32 bit int, so we return it as a string
read_longlong()  : int|string
Even on 64 bit systems PHP integers are signed.
read_longstr()  : string
Read a string that's up to 2**32 bytes, the encoding isn't specified in the AMQP spec, so just return it as a plain PHP string.
read_octet()  : int
read_php_int()  : int|string
Reads 32 bit integer in big-endian byte order.
read_short()  : int
read_shortstr()  : string
Read a utf-8 encoded string that's stored in up to 255 bytes. Return it decoded as a PHP unicode object.
read_signed_longlong()  : int|string
read_signed_octet()  : int
read_signed_short()  : int
read_table()  : array<string|int, mixed>|AMQPTable
Read an AMQP table, and return as a PHP array. keys are strings, values are (type,value) tuples.
read_table_object()  : array<string|int, mixed>|AMQPTable
read_timestamp()  : int|string
Read and AMQP timestamp, which is a 64-bit integer representing seconds since the Unix epoch in 1-second resolution.
read_value()  : mixed
Reads the next value as the provided field type.
readFrameHeader()  : array<string|int, mixed>
convertByteOrder()  : string
correctEndianness()  : string
Converts byte-string between native and network byte order, in both directions
getBigInteger()  : BigInteger
getLongMSB()  : bool
getMSB()  : bool
isLittleEndian()  : bool
rawread()  : string
resetCounters()  : void
tell()  : int
readSignedLong()  : int

Constants

PLATFORM_64BIT

protected bool PLATFORM_64BIT = PHP_INT_SIZE === 8

Properties

Methods

close()

Close the byte stream.

public abstract close() : void
Return values
void

read()

public read(int $n) : string
Parameters
$n : int
Return values
string

read_array()

Reads the array in the next value.

public read_array([bool $returnObject = false ]) : array<string|int, mixed>|AMQPArray
Parameters
$returnObject : bool = false

Whether to return AMQPArray instance instead of plain array

Return values
array<string|int, mixed>|AMQPArray

read_bit()

public read_bit() : bool
Return values
bool

read_double()

public read_double() : float
Return values
float

read_float()

public read_float() : float
Return values
float

read_long()

PHP does not have unsigned 32 bit int, so we return it as a string

public read_long() : int|string
Return values
int|string

read_longlong()

Even on 64 bit systems PHP integers are signed.

public read_longlong() : int|string

Since we need an unsigned value here we return it as a string.

Return values
int|string

read_longstr()

Read a string that's up to 2**32 bytes, the encoding isn't specified in the AMQP spec, so just return it as a plain PHP string.

public read_longstr() : string
Return values
string

read_octet()

public read_octet() : int
Return values
int

read_php_int()

Reads 32 bit integer in big-endian byte order.

public read_php_int() : int|string

On 64 bit systems it will return always unsigned int value in 0..2^32 range.

On 32 bit systems it will return signed int value in -2^31...+2^31 range.

Use with caution!

Return values
int|string

read_short()

public read_short() : int
Return values
int

read_shortstr()

Read a utf-8 encoded string that's stored in up to 255 bytes. Return it decoded as a PHP unicode object.

public read_shortstr() : string
Return values
string

read_signed_longlong()

public read_signed_longlong() : int|string
Return values
int|string

read_signed_octet()

public read_signed_octet() : int
Return values
int

read_signed_short()

public read_signed_short() : int
Return values
int

read_table()

Read an AMQP table, and return as a PHP array. keys are strings, values are (type,value) tuples.

public read_table([bool $returnObject = false ]) : array<string|int, mixed>|AMQPTable
Parameters
$returnObject : bool = false

Whether to return AMQPArray instance instead of plain array

Return values
array<string|int, mixed>|AMQPTable

read_timestamp()

Read and AMQP timestamp, which is a 64-bit integer representing seconds since the Unix epoch in 1-second resolution.

public read_timestamp() : int|string
Return values
int|string

read_value()

Reads the next value as the provided field type.

public read_value(int $fieldType[, bool $collectionsAsObjects = false ]) : mixed
Parameters
$fieldType : int

One of AMQPAbstractCollection::T_* constants

$collectionsAsObjects : bool = false

Description

Tags
throws
AMQPDataReadException
Return values
mixed

readFrameHeader()

public readFrameHeader() : array<string|int, mixed>
Return values
array<string|int, mixed>

convertByteOrder()

protected convertByteOrder(string $bytes) : string
Parameters
$bytes : string
Return values
string

correctEndianness()

Converts byte-string between native and network byte order, in both directions

protected correctEndianness(string $bytes) : string
Parameters
$bytes : string
Return values
string

getBigInteger()

protected static getBigInteger(string $value[, int $base = 10 ]) : BigInteger
Parameters
$value : string
$base : int = 10
Return values
BigInteger

getLongMSB()

protected getLongMSB(int $longInt) : bool
Parameters
$longInt : int
Return values
bool

getMSB()

protected getMSB(string $bytes) : bool
Parameters
$bytes : string
Return values
bool

isLittleEndian()

protected static isLittleEndian() : bool
Return values
bool

rawread()

protected abstract rawread(int $n) : string
Parameters
$n : int
Return values
string

resetCounters()

protected resetCounters() : void
Return values
void

tell()

protected tell() : int
Return values
int

readSignedLong()

private readSignedLong() : int
Return values
int

Search results