AbstractFilterableInputStream
in package
implements
InputInterface, FilterableInterface
Abstract filterable input stream class
Tags
Interfaces, Classes and Traits
- InputInterface
- Input byte stream interface
- FilterableInterface
- Filterable interface
Table of Contents
- $sequence : int
- Write sequence
- $filters : array<string|int, mixed>
- StreamFilters
- $mirrors : array<string|int, mixed>
- Bound streams
- $writeBuffer : string
- 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
- commitBytes() : 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() : int
- Run $bytes through all filters
Properties
$sequence
Write sequence
protected
int
$sequence
= 0
$filters
StreamFilters
private
array<string|int, mixed>
$filters
= []
$mirrors
Bound streams
private
array<string|int, mixed>
$mirrors
= []
$writeBuffer
A buffer for writing
private
string
$writeBuffer
= ''
Methods
addFilter()
Add a StreamFilter to this InputByteStream
public
addFilter(FilterInterface $filter, string $key) : mixed
Parameters
- $filter : FilterInterface
- $key : string
Return values
mixed —bind()
Attach $is to this stream.
public
bind(InputInterface $is) : mixed
The stream acts as an observer, receiving all data that is written. All and operations will be mirrored.
Parameters
- $is : InputInterface
Return values
mixed —commit()
For any bytes that are currently buffered inside the stream, force them off the buffer
public
commit() : mixed
Return values
mixed —flushBuffers()
Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
public
flushBuffers() : mixed
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(InputInterface $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 : InputInterface
Return values
mixed —write()
Writes $bytes to the end of the stream
public
write(string $bytes) : int
Parameters
- $bytes : string
Return values
int —commitBytes()
Commit the given bytes to the storage medium immediately
protected
abstract commitBytes(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(int $bytes) : mixed
Parameters
- $bytes : int
Return values
mixed —filter()
Run $bytes through all filters
private
filter(int $bytes) : int
Parameters
- $bytes : int