Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Utility class to walk through a data stream byte by byte with conventional names

__construct(
string $stream
)
:
void
Constructor
Create a reference to a byte stream that is going to be parsed or created by the methods in the class. Detect if the class should use big or little Endian encoding.
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. |

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 |

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 |

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
Usually a string.
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

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 |