Class Zend_Amf_Util_BinaryStream

Description

Utility class to walk through a data stream byte by byte with conventional names

Located in /Amf/Util/BinaryStream.php (line 31)


	
			
Direct descendents
Class Description
 class Zend_Amf_Parse_OutputStream Iterate at a binary level through the AMF response
 class Zend_Amf_Parse_InputStream InputStream is used to iterate at a binary level through the AMF request.
Variable Summary
Method Summary
 void __construct (string $stream)
 string getStream ()
 int readByte ()
 string readBytes (int $length)
 double readDouble ()
 int readInt ()
 double readLong ()
 string readLongUtf ()
 double readUnsignedShort ()
 string readUtf ()
 Zend_Amf_Util_BinaryStream writeDouble (string|double $stream)
 Zend_Amf_Util_BinaryStream writeLong (int|string $stream)
Variables
bool $_bigEndian (line 46)
  • var: BigEndian encoding?
  • access: protected
int $_needle (line 51)
  • var: Current position in stream
  • access: protected
string $_stream (line 36)
  • var: Byte stream
  • access: protected
int $_streamLength (line 41)
  • var: Length of stream
  • access: protected
Methods
Constructor __construct (line 63)

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.

  • access: public
void __construct (string $stream)
  • string $stream: use '' if creating a new stream or pass a string if reading.

Redefined in descendants as:
getStream (line 81)

Returns the current stream

  • access: public
string getStream ()
readByte (line 124)

Reads a signed byte

  • return: Value is in the range of -128 to 127.
  • access: public
int readByte ()
readBytes (line 94)

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.
  • throws: Zend_Amf_Exception for buffer underrun
  • access: public
string readBytes (int $length)
  • int $length
readDouble (line 256)

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

  • return: Floating point number
  • access: public
double readDouble ()
readInt (line 151)

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

  • return: Value is in the range of -2147483648 to 2147483647
  • access: public
int readInt ()
readLong (line 221)

Read a long numeric value

  • access: public
double readLong ()
readLongUtf (line 198)

Read a long UTF string

  • access: public
string readLongUtf ()
readUnsignedShort (line 244)

Read a 16 bit unsigned short.

  • todo: This could use the unpack() w/ S,n, or v
  • access: public
double readUnsignedShort ()
readUtf (line 173)

Reads a UTF-8 string from the data stream

  • return: A UTF-8 string produced by the byte representation of characters
  • access: public
string readUtf ()
writeByte (line 140)

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

  • access: public
Zend_Amf_Util_BinaryStream writeByte (string $stream)
  • string $stream
writeBytes (line 113)

Write any length of bytes to the stream

Usually a string.

  • access: public
Zend_Amf_Util_BinaryStream writeBytes (string $bytes)
  • string $bytes
writeDouble (line 275)

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

  • access: public
Zend_Amf_Util_BinaryStream writeDouble (string|double $stream)
  • string|double $stream
writeInt (line 162)

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

  • access: public
Zend_Amf_Util_BinaryStream writeInt (int $stream)
  • int $stream
writeLong (line 232)

Write long numeric value to output stream

  • access: public
Zend_Amf_Util_BinaryStream writeLong (int|string $stream)
  • int|string $stream
writeLongUtf (line 210)

Write a long UTF string to the buffer

  • access: public
Zend_Amf_Util_BinaryStream writeLongUtf (string $stream)
  • string $stream
writeUtf (line 185)

Wite a UTF-8 string to the outputstream

  • access: public
Zend_Amf_Util_BinaryStream writeUtf (string $stream)
  • string $stream

Documentation generated on Mon, 21 Jun 2010 15:09:05 -0400 by phpDocumentor 1.4.3