API Documentation

Amf/Util/BinaryStream.php

Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Amf
subpackage
Util
version
$Id: BinaryStream.php 21210 2010-02-27 10:37:39Z yoshida@zend.co.jp $
Classes
Zend_Amf_Util_BinaryStream

Description

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.

Zend_Amf_Util_BinaryStream

copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Amf
subpackage
Util
Properties
$_stream
$_streamLength
$_bigEndian
$_needle
Methods
__construct
getStream
readBytes
writeBytes
readByte
writeByte
readInt
writeInt
readUtf
writeUtf
readLongUtf
writeLongUtf
readLong
writeLong
readUnsignedShort
readDouble
writeDouble

Description

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

Properties

$_bigEndian

bool $_bigEndian = ''

Details

$_bigEndian
bool
BigEndian encoding?
visibility
protected
default
final
false
static
false

$_needle

int $_needle = ''

Details

$_needle
int
Current position in stream
visibility
protected
default
final
false
static
false

$_stream

string $_stream = ''

Details

$_stream
string
Byte stream
visibility
protected
default
final
false
static
false

$_streamLength

int $_streamLength = ''

Details

$_streamLength
int
Length of stream
visibility
protected
default
final
false
static
false

Methods

__construct

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

Arguments
$stream
string
use '' if creating a new stream or pass a string if reading.
Details
visibility
public
final
false
static
false

getStream

getStream( ) : string

Returns the current stream

Output
string
Details
visibility
public
final
false
static
false

readByte

readByte( ) : int

Reads a signed byte

Output
int
Value is in the range of -128 to 127.
Details
visibility
public
final
false
static
false

readBytes

readBytes( int $length ) : string

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

Arguments
$length
int
Output
string
Details
visibility
public
final
false
static
false
throws
for buffer underrun
todo
Should check that there are enough bytes left in the stream we are about to read.

readDouble

readDouble( ) : double

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

Output
double
Floating point number
Details
visibility
public
final
false
static
false

readInt

readInt( ) : int

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

Output
int
Value is in the range of -2147483648 to 2147483647
Details
visibility
public
final
false
static
false

readLong

readLong( ) : double

Read a long numeric value

Output
double
Details
visibility
public
final
false
static
false

readLongUtf

readLongUtf( ) : string

Read a long UTF string

Output
string
Details
visibility
public
final
false
static
false

readUnsignedShort

readUnsignedShort( ) : double

Read a 16 bit unsigned short.

Output
double
Details
visibility
public
final
false
static
false
todo
This could use the unpack() w/ S,n, or v

readUtf

readUtf( ) : string

Reads a UTF-8 string from the data stream

Output
string
A UTF-8 string produced by the byte representation of characters
Details
visibility
public
final
false
static
false

writeByte

writeByte( string $stream ) : Zend_Amf_Util_BinaryStream

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

Arguments
$stream
string
Details
visibility
public
final
false
static
false

writeBytes

writeBytes( string $bytes ) : Zend_Amf_Util_BinaryStream

Write any length of bytes to the stream

Usually a string.

Arguments
$bytes
string
Details
visibility
public
final
false
static
false

writeDouble

writeDouble( string|double $stream ) : Zend_Amf_Util_BinaryStream

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

Arguments
$stream
stringdouble
Details
visibility
public
final
false
static
false

writeInt

writeInt( int $stream ) : Zend_Amf_Util_BinaryStream

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

Arguments
$stream
int
Details
visibility
public
final
false
static
false

writeLong

writeLong( int|string $stream ) : Zend_Amf_Util_BinaryStream

Write long numeric value to output stream

Arguments
$stream
intstring
Details
visibility
public
final
false
static
false

writeLongUtf

writeLongUtf( string $stream ) : Zend_Amf_Util_BinaryStream

Write a long UTF string to the buffer

Arguments
$stream
string
Details
visibility
public
final
false
static
false

writeUtf

writeUtf( string $stream ) : Zend_Amf_Util_BinaryStream

Wite a UTF-8 string to the outputstream

Arguments
$stream
string
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.