Swift_ByteStream_AbstractFilterableInputStream
in package
implements
Swift_InputByteStream, Swift_Filterable
Provides the base functionality for an InputStream supporting filters.
Tags
Interfaces, Classes and Traits
- Swift_InputByteStream
- An abstract means of writing data.
- Swift_Filterable
- Allows StreamFilters to operate on a stream.
Table of Contents
- $sequence : mixed
- Write sequence.
- $filters : array<string|int, Swift_StreamFilter>
- StreamFilters.
- $mirrors : array<string|int, Swift_InputByteStream>
- Bound streams.
- $writeBuffer : mixed
- A buffer for writing.
- addFilter() : mixed
- Add a StreamFilter to this InputByteStream.
- bind() : mixed
- Attach $is to this stream.
- commit() : mixed
- For any bytes that are currently buffered inside the stream, force them off the buffer.
- flushBuffers() : mixed
- Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
- removeFilter() : mixed
- Remove an already present StreamFilter based on its $key.
- unbind() : mixed
- Remove an already bound stream.
- write() : int
- Writes $bytes to the end of the stream.
- doCommit() : mixed
- Commit the given bytes to the storage medium immediately.
- flush() : mixed
- Flush any buffers/content with immediate effect.
- doWrite() : mixed
- Just write the bytes to the stream
- filter() : mixed
- Run $bytes through all filters
Properties
$sequence
Write sequence.
protected
mixed
$sequence
= 0
$filters
StreamFilters.
private
array<string|int, Swift_StreamFilter>
$filters
= []
$mirrors
Bound streams.
private
array<string|int, Swift_InputByteStream>
$mirrors
= []
$writeBuffer
A buffer for writing.
private
mixed
$writeBuffer
= ''
Methods
addFilter()
Add a StreamFilter to this InputByteStream.
public
addFilter(Swift_StreamFilter $filter, string $key) : mixed
Parameters
- $filter : Swift_StreamFilter
- $key : string
Return values
mixed —bind()
Attach $is to this stream.
public
bind(Swift_InputByteStream $is) : mixed
The stream acts as an observer, receiving all data that is written. All and operations will be mirrored.
Parameters
- $is : Swift_InputByteStream
Return values
mixed —commit()
For any bytes that are currently buffered inside the stream, force them off the buffer.
public
commit() : mixed
Tags
Return values
mixed —flushBuffers()
Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
public
flushBuffers() : mixed
Tags
Return values
mixed —removeFilter()
Remove an already present StreamFilter based on its $key.
public
removeFilter(string $key) : mixed
Parameters
- $key : string
Return values
mixed —unbind()
Remove an already bound stream.
public
unbind(Swift_InputByteStream $is) : mixed
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
- $is : Swift_InputByteStream
Return values
mixed —write()
Writes $bytes to the end of the stream.
public
write(string $bytes) : int
Parameters
- $bytes : string
Tags
Return values
int —doCommit()
Commit the given bytes to the storage medium immediately.
protected
abstract doCommit(string $bytes) : mixed
Parameters
- $bytes : string
Return values
mixed —flush()
Flush any buffers/content with immediate effect.
protected
abstract flush() : mixed
Return values
mixed —doWrite()
Just write the bytes to the stream
private
doWrite(mixed $bytes) : mixed
Parameters
- $bytes : mixed
Return values
mixed —filter()
Run $bytes through all filters
private
filter(mixed $bytes) : mixed
Parameters
- $bytes : mixed