Inheritances
Files
Overview
FRAMES
NO FRAMES

Class Zend_Amf_Util_BinaryStream

Zend_Amf
|-Zend_Amf_Util
|- class Zend_Amf_Util_BinaryStream
Utility class to walk through a data stream byte by byte with conventional names
PackageZend_Amf
SubpackageUtil
CopyrightCopyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
Licensehttp://framework.zend.com/license/new-bsd New BSD License

Summary

Instance fields
# $_bigEndian
# $_needle
# $_stream
# $_streamLength
Instance methods
+ __construct() Constructor
+ getStream() Returns the current stream
+ readByte() Reads a signed byte
+ readBytes() Read the number of bytes in a row for the length supplied
+ readDouble() Reads an IEEE 754 double-precision floating point number from the data stream
+ readInt() Reads a signed 32-bit integer from the data stream
+ readLong() Read a long numeric value
+ readLongUtf() Read a long UTF string
+ readUnsignedShort() Read a 16 bit unsigned short
+ readUtf() Reads a UTF-8 string from the data stream
+ writeByte() Writes the passed string into a signed byte on the stream
+ writeBytes() Write any length of bytes to the stream
+ writeDouble() Writes an IEEE 754 double-precision floating point number from the data stream
+ writeInt() Write an the integer to the output stream as a 32 bit signed integer
+ writeLong() Write long numeric value to output stream
+ writeLongUtf() Write a long UTF string to the buffer
+ writeUtf() Wite a UTF-8 string to the outputstream

Details

Instance fields

$_bigEndian
protected $_bigEndian
Var bool BigEndian encoding?
$_needle
protected $_needle
Var int Current position in stream
$_stream
protected $_stream
Var string Byte stream
$_streamLength
protected $_streamLength
Var int Length of stream

Instance methods

__construct()
public function __construct( $stream)
Constructor

Create a refrence 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.
Parameters
string $stream use '' if creating a new stream or pass a string if reading.
Returns void
Overriden by __construct() in class : Zend_Amf_Parse_OutputStream
getStream()
public function getStream( )
Returns the current stream
Returns string
readByte()
public function readByte( )
Reads a signed byte
Returns int Value is in the range of -128 to 127.
readBytes()
public function readBytes( $length)
Read the number of bytes in a row for the length supplied.
Parameters
int $length
Returns string
Throws Zend_Amf_Exception for buffer underrun
To do Should check that there are enough bytes left in the stream we are about to read.
readDouble()
public function readDouble( )
Reads an IEEE 754 double-precision floating point number from the data stream.
Returns double Floating point number
readInt()
public function readInt( )
Reads a signed 32-bit integer from the data stream.
Returns int Value is in the range of -2147483648 to 2147483647
readLong()
public function readLong( )
Read a long numeric value
Returns double
readLongUtf()
public function readLongUtf( )
Read a long UTF string
Returns string
readUnsignedShort()
public function readUnsignedShort( )
Read a 16 bit unsigned short.
Returns double
To do This could use the unpack() w/ S,n, or v
readUtf()
public function readUtf( )
Reads a UTF-8 string from the data stream
Returns string A UTF-8 string produced by the byte representation of characters
writeByte()
public function writeByte( $stream)
Writes the passed string into a signed byte on the stream.
Parameters
string $stream
writeBytes()
public function writeBytes( $bytes)
Write any length of bytes to the stream

Usually a string.
Parameters
string $bytes
writeDouble()
public function writeDouble( $stream)
Writes an IEEE 754 double-precision floating point number from the data stream.
Parameters
string|double $stream
writeInt()
public function writeInt( $stream)
Write an the integer to the output stream as a 32 bit signed integer
Parameters
int $stream
writeLong()
public function writeLong( $stream)
Write long numeric value to output stream
Parameters
int|string $stream
writeLongUtf()
public function writeLongUtf( $stream)
Write a long UTF string to the buffer
Parameters
string $stream
writeUtf()
public function writeUtf( $stream)
Wite a UTF-8 string to the outputstream
Parameters
string $stream