API Documentation

Zend/Amf/Util/BinaryStream.php

Show: inherited
Table of Contents

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.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Amf  
Subpackage
Util  
Version
$Id: BinaryStream.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Amf_Util_BinaryStream

Package: Zend\Amf\Util

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

Children
\Zend_Amf_Parse_OutputStream
\Zend_Amf_Parse_InputStream
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Used_by
\Zend_Amf_Parse_OutputStream  

Properties

Propertyprotectedbool  $_bigEndian= ''

BigEndian encoding?
Details
Type
bool
Propertyprotectedint  $_needle= ''

Current position in stream
Details
Type
int
Propertyprotectedstring  $_stream= ''

Byte stream
Details
Type
string
Propertyprotectedint  $_streamLength= ''

Length of stream
Details
Type
int

Methods

methodpublic__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.

Parameters
Name Type Description
$stream string

use '' if creating a new stream or pass a string if reading.

methodpublicgetStream( ) : string

Returns the current stream

Returns
Type Description
string
methodpublicreadByte( ) : int

Reads a signed byte

Returns
Type Description
int Value is in the range of -128 to 127.
methodpublicreadBytes( int $length ) : string

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

Parameters
Name Type Description
$length int
Returns
Type Description
string
Throws
Exception Description
\Zend_Amf_Exception for buffer underrun
Details
Todo
Should check that there are enough bytes left in the stream we are about to read.  
methodpublicreadDouble( ) : double

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

Returns
Type Description
double Floating point number
methodpublicreadInt( ) : int

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

Returns
Type Description
int Value is in the range of -2147483648 to 2147483647
methodpublicreadLong( ) : double

Read a long numeric value

Returns
Type Description
double
methodpublicreadLongUtf( ) : string

Read a long UTF string

Returns
Type Description
string
methodpublicreadUnsignedShort( ) : double

Read a 16 bit unsigned short.

Returns
Type Description
double
Details
Todo
This could use the unpack() w/ S,n, or v  
methodpublicreadUtf( ) : string

Reads a UTF-8 string from the data stream

Returns
Type Description
string A UTF-8 string produced by the byte representation of characters
methodpublicwriteByte( string $stream ) : \Zend_Amf_Util_BinaryStream

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

Parameters
Name Type Description
$stream string
Returns
Type Description
\Zend_Amf_Util_BinaryStream
methodpublicwriteBytes( string $bytes ) : \Zend_Amf_Util_BinaryStream

Write any length of bytes to the stream

Usually a string.

Parameters
Name Type Description
$bytes string
Returns
Type Description
\Zend_Amf_Util_BinaryStream
methodpublicwriteDouble( string|double $stream ) : \Zend_Amf_Util_BinaryStream

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

Parameters
Name Type Description
$stream string|double
Returns
Type Description
\Zend_Amf_Util_BinaryStream
methodpublicwriteInt( int $stream ) : \Zend_Amf_Util_BinaryStream

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

Parameters
Name Type Description
$stream int
Returns
Type Description
\Zend_Amf_Util_BinaryStream
methodpublicwriteLong( int|string $stream ) : \Zend_Amf_Util_BinaryStream

Write long numeric value to output stream

Parameters
Name Type Description
$stream int|string
Returns
Type Description
\Zend_Amf_Util_BinaryStream
methodpublicwriteLongUtf( string $stream ) : \Zend_Amf_Util_BinaryStream

Write a long UTF string to the buffer

Parameters
Name Type Description
$stream string
Returns
Type Description
\Zend_Amf_Util_BinaryStream
methodpublicwriteUtf( string $stream ) : \Zend_Amf_Util_BinaryStream

Wite a UTF-8 string to the outputstream

Parameters
Name Type Description
$stream string
Returns
Type Description
\Zend_Amf_Util_BinaryStream
Documentation was generated by DocBlox 0.15.1.