Swift
[ class tree: Swift ] [ index: Swift ] [ all elements ]

Class: Swift_ByteStream_ArrayByteStream

Source Location: /vendors/swift/classes/Swift/ByteStream/ArrayByteStream.php

Class Overview


Allows reading and writing of bytes to and from an array.


Author(s):

  • Chris Corbyn

Implements interfaces:

Methods



Class Details

[line 20]
Allows reading and writing of bytes to and from an array.



Tags:

author:  Chris Corbyn
filesource:  Source Code for this file


[ Top ]


Class Methods


constructor __construct [line 53]

Swift_ByteStream_ArrayByteStream __construct( [mixed $stack = null])

Create a new ArrayByteStream.

If $stack is given the stream will be populated with the bytes it contains.




Tags:

access:  public


Parameters:

mixed   $stack   of bytes in string or array form, optional

[ Top ]

method bind [line 131]

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




Tags:

access:  public



Implementation of:
Swift_InputByteStream::bind()
Attach $is to this stream.

Parameters:

Swift_InputByteStream   $is  

[ Top ]

method commit [line 120]

void commit( )

Not used.



Tags:

access:  public



Implementation of:
Swift_InputByteStream::commit()
For any bytes that are currently buffered inside the stream, force them off the buffer.
[ Top ]

method flushBuffers [line 178]

void flushBuffers( )

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



Tags:

access:  public



Implementation of:
Swift_InputByteStream::flushBuffers()
Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
[ Top ]

method read [line 78]

string read( int $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.



Tags:

access:  public



Implementation of:
Swift_OutputByteStream::read()
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  

[ Top ]

method setReadPointer [line 160]

boolean setReadPointer( int $byteOffset)

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



Tags:

access:  public



Implementation of:
Swift_OutputByteStream::setReadPointer()
Move the internal read pointer to $byteOffset in the stream.

Parameters:

int   $byteOffset  

[ Top ]

method unbind [line 144]

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




Tags:

access:  public



Implementation of:
Swift_InputByteStream::unbind()
Remove an already bound stream.

Parameters:

Swift_InputByteStream   $is  

[ Top ]

method write [line 102]

void write( string $bytes)

Writes $bytes to the end of the stream.



Tags:

access:  public



Implementation of:
Swift_InputByteStream::write()
Writes $bytes to the end of the stream.

Parameters:

string   $bytes  

[ Top ]


Documentation generated on Mon, 05 Sep 2011 20:31:57 -0500 by phpDocumentor 1.4.3