php-amqplib

AMQPWriter 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  : array<string|int, mixed>
$isLittleEndian  : bool
$out  : string
getvalue()  : string
Get what's been encoded so far.
write()  : $this
Write a plain PHP string, with no special encoding.
write_array()  : self
Supports the writing of Array types, so that you can implement array methods, like Rabbitmq's HA parameters
write_bit()  : $this
Write a boolean value.
write_bits()  : $this
Write multiple bits as an octet
write_long()  : $this
Write an integer as an unsigned 32-bit value
write_longlong()  : $this
Write a numeric value as an unsigned 64-bit value
write_longstr()  : $this
Write a string up to 2**32 bytes long. Assume UTF-8 encoding
write_octet()  : $this
Write an integer as an unsigned 8-bit value
write_short()  : $this
Write an integer as an unsigned 16-bit value
write_shortstr()  : $this
Write a string up to 255 bytes long after encoding.
write_signed_longlong()  : $this
write_signed_octet()  : $this
write_signed_short()  : $this
write_table()  : $this
Write PHP array, as table. Input array format: keys are strings, values are (type,value) tuples.
write_table_object()  : $this
for compat with method mapping used by AMQPMessage
write_timestamp()  : $this
Write unix time_t value as 64 bit timestamp
convertByteOrder()  : string
correctEndianness()  : string
Converts byte-string between native and network byte order, in both directions
getBigInteger()  : BigInteger
getLongMSB()  : bool
getMSB()  : bool
isLittleEndian()  : bool
flushbits()  : mixed
writeSignedLong()  : $this
writeValue()  : mixed

Constants

PLATFORM_64BIT

protected bool PLATFORM_64BIT = PHP_INT_SIZE === 8

Properties

$bits

protected array<string|int, mixed> $bits = array()

Methods

getvalue()

Get what's been encoded so far.

public getvalue() : string
Return values
string

write()

Write a plain PHP string, with no special encoding.

public write(string $s) : $this
Parameters
$s : string
Return values
$this

write_array()

Supports the writing of Array types, so that you can implement array methods, like Rabbitmq's HA parameters

public write_array(AMQPArray|array<string|int, mixed> $a) : self
Parameters
$a : AMQPArray|array<string|int, mixed>

Instance of AMQPArray or PHP array WITHOUT format hints (unlike write_table())

Return values
self

write_bit()

Write a boolean value.

public write_bit(bool $b) : $this

(deprecated, use write_bits instead)

Parameters
$b : bool
Tags
deprecated
Return values
$this

write_bits()

Write multiple bits as an octet

public write_bits(array<string|int, bool> $bits) : $this
Parameters
$bits : array<string|int, bool>
Return values
$this

write_long()

Write an integer as an unsigned 32-bit value

public write_long(int|string $n) : $this
Parameters
$n : int|string
Return values
$this

write_longlong()

Write a numeric value as an unsigned 64-bit value

public write_longlong(int|string $n) : $this
Parameters
$n : int|string
Tags
throws
AMQPOutOfRangeException
Return values
$this

write_longstr()

Write a string up to 2**32 bytes long. Assume UTF-8 encoding

public write_longstr(string $s) : $this
Parameters
$s : string
Return values
$this

write_shortstr()

Write a string up to 255 bytes long after encoding.

public write_shortstr(string $s) : $this

Assume UTF-8 encoding

Parameters
$s : string
Tags
throws
AMQPInvalidArgumentException
Return values
$this

write_signed_longlong()

public write_signed_longlong(int|string $n) : $this
Parameters
$n : int|string
Return values
$this

write_signed_octet()

public write_signed_octet(int $n) : $this
Parameters
$n : int
Return values
$this

write_signed_short()

public write_signed_short(int $n) : $this
Parameters
$n : int
Return values
$this

write_table()

Write PHP array, as table. Input array format: keys are strings, values are (type,value) tuples.

public write_table(AMQPTable|array<string|int, mixed> $d) : $this
Parameters
$d : AMQPTable|array<string|int, mixed>

Instance of AMQPTable or PHP array WITH format hints (unlike write_array())

Tags
throws
AMQPInvalidArgumentException
Return values
$this

write_table_object()

for compat with method mapping used by AMQPMessage

public write_table_object(AMQPTable|array<string|int, mixed> $d) : $this
Parameters
$d : AMQPTable|array<string|int, mixed>
Return values
$this

write_timestamp()

Write unix time_t value as 64 bit timestamp

public write_timestamp(int $v) : $this
Parameters
$v : int
Return values
$this

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

flushbits()

private flushbits() : mixed
Return values
mixed

writeSignedLong()

private writeSignedLong(int $n) : $this
Parameters
$n : int
Return values
$this

writeValue()

private writeValue(int $type, mixed $val) : mixed
Parameters
$type : int

One of AMQPAbstractCollection::T_* constants

$val : mixed
Return values
mixed

Search results