Provides the base functionality for an InputStream supporting filters.

package Swift
subpackage ByteStream
author Chris Corbyn

 Methods

Add a StreamFilter to this InputByteStream.

addFilter(\Swift_StreamFilter $filter, string $key) 

Parameters

$key

string

Attach $is to this stream.

bind(\Swift_InputByteStream $is) 

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

Parameters

For any bytes that are currently buffered inside the stream, force them off the buffer.

commit() 

Exceptions

\Swift_IoException

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

flushBuffers() 

Exceptions

\Swift_IoException

Remove an already present StreamFilter based on its $key.

removeFilter(string $key) 

Parameters

$key

string

Remove an already bound stream.

unbind(\Swift_InputByteStream $is) 

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

Writes $bytes to the end of the stream.

write(string $bytes) : int

Writing may not happen immediately if the stream chooses to buffer. If you want to write these bytes with immediate effect, call commit() after calling write().

This method returns the sequence ID of the write (i.e. 1 for first, 2 for second, etc etc).

Parameters

$bytes

string

Exceptions

\Swift_IoException

Returns

int

Commit the given bytes to the storage medium immediately.

_commit(string $bytes) 
access protected

Parameters

$bytes

string

Flush any buffers/content with immediate effect.

_flush() 
access protected

Just write the bytes to the stream

_doWrite($bytes) 

Parameters

$bytes

Run $bytes through all filters

_filter($bytes) 

Parameters

$bytes

 Properties

 

$_sequence 
 

$_filters 
 

$_mirrors 
 

$_writeBuffer