Amf/Util/BinaryStream.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Amf
- Subpackage
- Util
- Version
- $Id$
\Zend_Amf_Util_BinaryStream
- Children
- \Zend_Amf_Parse_OutputStream
- \Zend_Amf_Parse_InputStream
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties


bool $_mbStringFunctionsOverloaded
str* functions overloaded using mbstring.func_overload?
- Type
- bool
Methods


__construct(string $stream) : void
Constructor
Name | Type | Description |
---|---|---|
$stream | string | use '' if creating a new stream or pass a string if reading. |


readByte() : int
Reads a signed byte
Type | Description |
---|---|
int | Value is in the range of -128 to 127. |
Exception | Description |
---|---|
\Zend_Amf_Exception |


readBytes(int $length) : string
Read the number of bytes in a row for the length supplied.
Name | Type | Description |
---|---|---|
$length | int |
Type | Description |
---|---|
string |
Exception | Description |
---|---|
\Zend_Amf_Exception | for buffer underrun |
- Todo
- Should check that there are enough bytes left in the stream we are about to read.


readDouble() : double
Reads an IEEE 754 double-precision floating point number from the data stream.
Type | Description |
---|---|
double | Floating point number |


readInt() : int
Reads a signed 32-bit integer from the data stream.
Type | Description |
---|---|
int | Value is in the range of -2147483648 to 2147483647 |


readUnsignedShort() : double
Read a 16 bit unsigned short.
Type | Description |
---|---|
double |
- Todo
- This could use the unpack() w/ S,n, or v


readUtf() : string
Reads a UTF-8 string from the data stream
Type | Description |
---|---|
string | A UTF-8 string produced by the byte representation of characters |


writeByte(string $stream) : \Zend_Amf_Util_BinaryStream
Writes the passed string into a signed byte on the stream.
Name | Type | Description |
---|---|---|
$stream | string |
Type | Description |
---|---|
\Zend_Amf_Util_BinaryStream |


writeBytes(string $bytes) : \Zend_Amf_Util_BinaryStream
Write any length of bytes to the stream
Name | Type | Description |
---|---|---|
$bytes | string |
Type | Description |
---|---|
\Zend_Amf_Util_BinaryStream |


writeDouble(string | double $stream) : \Zend_Amf_Util_BinaryStream
Writes an IEEE 754 double-precision floating point number from the data stream.
Name | Type | Description |
---|---|---|
$stream | string | double |
Type | Description |
---|---|
\Zend_Amf_Util_BinaryStream |


writeInt(int $stream) : \Zend_Amf_Util_BinaryStream
Write an the integer to the output stream as a 32 bit signed integer
Name | Type | Description |
---|---|---|
$stream | int |
Type | Description |
---|---|
\Zend_Amf_Util_BinaryStream |


writeLong(int | string $stream) : \Zend_Amf_Util_BinaryStream
Write long numeric value to output stream
Name | Type | Description |
---|---|---|
$stream | int | string |
Type | Description |
---|---|
\Zend_Amf_Util_BinaryStream |


writeLongUtf(string $stream) : \Zend_Amf_Util_BinaryStream
Write a long UTF string to the buffer
Name | Type | Description |
---|---|---|
$stream | string |
Type | Description |
---|---|
\Zend_Amf_Util_BinaryStream |


writeUtf(string $stream) : \Zend_Amf_Util_BinaryStream
Wite a UTF-8 string to the outputstream
Name | Type | Description |
---|---|---|
$stream | string |
Type | Description |
---|---|
\Zend_Amf_Util_BinaryStream |