Amf/Util/BinaryStream.php

Show: PublicProtectedPrivateinherited
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-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Amf  
Subpackage
Util  
Version
$Id$  

\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-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedbool $_bigEndian

BigEndian encoding?

Details
Type
bool
>VPropertyprotectedbool $_mbStringFunctionsOverloaded

str* functions overloaded using mbstring.func_overload?

Details
Type
bool
>VPropertyprotectedint $_needle

Current position in stream

Details
Type
int
>VPropertyprotectedstring $_stream

Byte stream

Details
Type
string
>VPropertyprotectedint $_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
NameTypeDescription
$streamstring

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

methodpublicgetStream() : string

Returns the current stream

Returns
TypeDescription
string
methodpublicreadByte() : int

Reads a signed byte

Returns
TypeDescription
intValue is in the range of -128 to 127.
Throws
ExceptionDescription
\Zend_Amf_Exception
methodpublicreadBytes(int $length) : string

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

Parameters
NameTypeDescription
$lengthint
Returns
TypeDescription
string
Throws
ExceptionDescription
\Zend_Amf_Exceptionfor 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
TypeDescription
doubleFloating point number
methodpublicreadInt() : int

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

Returns
TypeDescription
intValue is in the range of -2147483648 to 2147483647
methodpublicreadLong() : double

Read a long numeric value

Returns
TypeDescription
double
methodpublicreadLongUtf() : string

Read a long UTF string

Returns
TypeDescription
string
methodpublicreadUnsignedShort() : double

Read a 16 bit unsigned short.

Returns
TypeDescription
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
TypeDescription
stringA 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
NameTypeDescription
$streamstring
Returns
TypeDescription
\Zend_Amf_Util_BinaryStream
methodpublicwriteBytes(string $bytes) : \Zend_Amf_Util_BinaryStream

Write any length of bytes to the stream

Usually a string.
Parameters
NameTypeDescription
$bytesstring
Returns
TypeDescription
\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
NameTypeDescription
$streamstring | double
Returns
TypeDescription
\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
NameTypeDescription
$streamint
Returns
TypeDescription
\Zend_Amf_Util_BinaryStream
methodpublicwriteLong(int | string $stream) : \Zend_Amf_Util_BinaryStream

Write long numeric value to output stream

Parameters
NameTypeDescription
$streamint | string
Returns
TypeDescription
\Zend_Amf_Util_BinaryStream
methodpublicwriteLongUtf(string $stream) : \Zend_Amf_Util_BinaryStream

Write a long UTF string to the buffer

Parameters
NameTypeDescription
$streamstring
Returns
TypeDescription
\Zend_Amf_Util_BinaryStream
methodpublicwriteUtf(string $stream) : \Zend_Amf_Util_BinaryStream

Wite a UTF-8 string to the outputstream

Parameters
NameTypeDescription
$streamstring
Returns
TypeDescription
\Zend_Amf_Util_BinaryStream
Documentation was generated by phpDocumentor 2.2.0 .