Moodle  2.2.1
http://www.collinsharper.com
Zend_Amf_Util_BinaryStream Class Reference
Inheritance diagram for Zend_Amf_Util_BinaryStream:

Public Member Functions

 __construct ($stream)
 getStream ()
 readBytes ($length)
 writeBytes ($bytes)
 readByte ()
 writeByte ($stream)
 readInt ()
 writeInt ($stream)
 readUtf ()
 writeUtf ($stream)
 readLongUtf ()
 writeLongUtf ($stream)
 readLong ()
 writeLong ($stream)
 readUnsignedShort ()
 readDouble ()
 writeDouble ($stream)

Protected Attributes

 $_stream
 $_streamLength
 $_bigEndian
 $_needle

Detailed Description

Definition at line 31 of file BinaryStream.php.


Constructor & Destructor Documentation

__construct ( stream)

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.

Parameters:
string$streamuse '' if creating a new stream or pass a string if reading.
Returns:
void

Definition at line 63 of file BinaryStream.php.


Member Function Documentation

getStream ( )

Returns the current stream

Returns:
string

Definition at line 81 of file BinaryStream.php.

readByte ( )

Reads a signed byte

Returns:
int Value is in the range of -128 to 127.

Definition at line 124 of file BinaryStream.php.

Here is the caller graph for this function:

readBytes ( length)

Read the number of bytes in a row for the length supplied.

Todo:
Should check that there are enough bytes left in the stream we are about to read.
Parameters:
int$length
Returns:
string
Exceptions:
Zend_Amf_Exceptionfor buffer underrun

Definition at line 94 of file BinaryStream.php.

Here is the caller graph for this function:

Reads an IEEE 754 double-precision floating point number from the data stream.

Returns:
double Floating point number

Definition at line 256 of file BinaryStream.php.

readInt ( )

Reads a signed 32-bit integer from the data stream.

Returns:
int Value is in the range of -2147483648 to 2147483647

Definition at line 151 of file BinaryStream.php.

Here is the call graph for this function:

Here is the caller graph for this function:

readLong ( )

Read a long numeric value

Returns:
double

Definition at line 221 of file BinaryStream.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Read a long UTF string

Returns:
string

Definition at line 198 of file BinaryStream.php.

Here is the call graph for this function:

Read a 16 bit unsigned short.

Todo:
This could use the unpack() w/ S,n, or v
Returns:
double

Definition at line 244 of file BinaryStream.php.

Here is the call graph for this function:

Here is the caller graph for this function:

readUtf ( )

Reads a UTF-8 string from the data stream

Returns:
string A UTF-8 string produced by the byte representation of characters

Definition at line 173 of file BinaryStream.php.

Here is the call graph for this function:

writeByte ( stream)

Writes the passed string into a signed byte on the stream.

Parameters:
string$stream
Returns:
Zend_Amf_Util_BinaryStream

Definition at line 140 of file BinaryStream.php.

Here is the caller graph for this function:

writeBytes ( bytes)

Write any length of bytes to the stream

Usually a string.

Parameters:
string$bytes
Returns:
Zend_Amf_Util_BinaryStream

Definition at line 113 of file BinaryStream.php.

writeDouble ( stream)

Writes an IEEE 754 double-precision floating point number from the data stream.

Parameters:
string | double$stream
Returns:
Zend_Amf_Util_BinaryStream

Definition at line 275 of file BinaryStream.php.

writeInt ( stream)

Write an the integer to the output stream as a 32 bit signed integer

Parameters:
int$stream
Returns:
Zend_Amf_Util_BinaryStream

Definition at line 162 of file BinaryStream.php.

Here is the caller graph for this function:

writeLong ( stream)

Write long numeric value to output stream

Parameters:
int | string$stream
Returns:
Zend_Amf_Util_BinaryStream

Definition at line 232 of file BinaryStream.php.

Here is the caller graph for this function:

writeLongUtf ( stream)

Write a long UTF string to the buffer

Parameters:
string$stream
Returns:
Zend_Amf_Util_BinaryStream

Definition at line 210 of file BinaryStream.php.

Here is the call graph for this function:

writeUtf ( stream)

Wite a UTF-8 string to the outputstream

Parameters:
string$stream
Returns:
Zend_Amf_Util_BinaryStream

Definition at line 185 of file BinaryStream.php.

Here is the call graph for this function:


Field Documentation

$_bigEndian [protected]

Definition at line 46 of file BinaryStream.php.

$_needle [protected]

Definition at line 51 of file BinaryStream.php.

$_stream [protected]

Definition at line 36 of file BinaryStream.php.

$_streamLength [protected]

Definition at line 41 of file BinaryStream.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations