XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
Swift_ByteStream_ArrayByteStream Class Reference
Inheritance diagram for Swift_ByteStream_ArrayByteStream:
Inheritance graph

Public Member Functions

 __construct ($stack=null)
 
 bind (Swift_InputByteStream $is)
 
 commit ()
 
 flushBuffers ()
 
 read ($length)
 
 setReadPointer ($byteOffset)
 
 unbind (Swift_InputByteStream $is)
 
 write ($bytes)
 

Private Attributes

 $_array = array()
 
 $_arraySize = 0
 
 $_mirrors = array()
 
 $_offset = 0
 

Detailed Description

Definition at line 20 of file ArrayByteStream.php.

Constructor & Destructor Documentation

Swift_ByteStream_ArrayByteStream::__construct (   $stack = null)

Create a new ArrayByteStream. If $stack is given the stream will be populated with the bytes it contains.

Parameters
mixed$stackof bytes in string or array form, optional

Definition at line 53 of file ArrayByteStream.php.

References elseif(), and write().

Here is the call graph for this function:

Member Function Documentation

Swift_ByteStream_ArrayByteStream::bind ( Swift_InputByteStream  $is)

Attach $is to this stream. The stream acts as an observer, receiving all data that is written. All write() and flushBuffers() operations will be mirrored.

Parameters
Swift_InputByteStream$is

Implements Swift_InputByteStream.

Definition at line 131 of file ArrayByteStream.php.

Swift_ByteStream_ArrayByteStream::commit ( )

Not used.

Implements Swift_InputByteStream.

Definition at line 120 of file ArrayByteStream.php.

Swift_ByteStream_ArrayByteStream::flushBuffers ( )

Flush the contents of the stream (empty it) and set the internal pointer to the beginning.

Implements Swift_InputByteStream.

Definition at line 178 of file ArrayByteStream.php.

Swift_ByteStream_ArrayByteStream::read (   $length)

Reads $length bytes from the stream into a string and moves the pointer through the stream by $length. If less bytes exist than are requested the remaining bytes are given instead. If no bytes are remaining at all, boolean false is returned.

Parameters
int$length
Returns
string

Implements Swift_OutputByteStream.

Definition at line 78 of file ArrayByteStream.php.

References $_offset, and $ret.

Swift_ByteStream_ArrayByteStream::setReadPointer (   $byteOffset)

Move the internal read pointer to $byteOffset in the stream.

Parameters
int$byteOffset
Returns
boolean

Implements Swift_OutputByteStream.

Definition at line 160 of file ArrayByteStream.php.

References $_arraySize, and elseif().

Here is the call graph for this function:

Swift_ByteStream_ArrayByteStream::unbind ( Swift_InputByteStream  $is)

Remove an already bound stream. If $is is not bound, no errors will be raised. If the stream currently has any buffered data it will be written to $is before unbinding occurs.

Parameters
Swift_InputByteStream$is

Implements Swift_InputByteStream.

Definition at line 144 of file ArrayByteStream.php.

Swift_ByteStream_ArrayByteStream::write (   $bytes)

Writes $bytes to the end of the stream.

Parameters
string$bytes

Implements Swift_InputByteStream.

Definition at line 102 of file ArrayByteStream.php.

Referenced by __construct().

Here is the caller graph for this function:

Member Data Documentation

Swift_ByteStream_ArrayByteStream::$_array = array()
private

Definition at line 29 of file ArrayByteStream.php.

Swift_ByteStream_ArrayByteStream::$_arraySize = 0
private

Definition at line 36 of file ArrayByteStream.php.

Referenced by setReadPointer().

Swift_ByteStream_ArrayByteStream::$_mirrors = array()
private

Bound streams

Definition at line 46 of file ArrayByteStream.php.

Swift_ByteStream_ArrayByteStream::$_offset = 0
private

Definition at line 43 of file ArrayByteStream.php.

Referenced by read().


The documentation for this class was generated from the following file: