\Pop\Mail\Transport\Smtp\Stream\ByteAbstractFilterableInputStream

Abstract filterable input stream class

Summary

Methods
Properties
Constants
addFilter()
removeFilter()
write()
commit()
bind()
unbind()
flushBuffers()
No public properties found
No constants found
commitBytes()
flush()
$sequence
N/A
filter()
doWrite()
$filters
$writeBuffer
$mirrors
N/A

Properties

$sequence

$sequence : integer

Write sequence

Type

integer

$filters

$filters : array

StreamFilters

Type

array

$writeBuffer

$writeBuffer : string

A buffer for writing

Type

string

$mirrors

$mirrors : array

Bound streams

Type

array

Methods

removeFilter()

removeFilter(string  $key) 

Remove an already present StreamFilter based on its $key

Parameters

string $key

write()

write(string  $bytes) : integer

Writes $bytes to the end of the stream

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

string $bytes

Returns

integer

commit()

commit() 

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

bind()

bind(\Pop\Mail\Transport\Smtp\Stream\Byte\InputInterface  $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

\Pop\Mail\Transport\Smtp\Stream\Byte\InputInterface $is

unbind()

unbind(\Pop\Mail\Transport\Smtp\Stream\Byte\InputInterface  $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

\Pop\Mail\Transport\Smtp\Stream\Byte\InputInterface $is

flushBuffers()

flushBuffers() 

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

commitBytes()

commitBytes(string  $bytes) 

Commit the given bytes to the storage medium immediately

Parameters

string $bytes

flush()

flush() 

Flush any buffers/content with immediate effect

filter()

filter(integer  $bytes) : integer

Run $bytes through all filters

Parameters

integer $bytes

Returns

integer

doWrite()

doWrite(integer  $bytes) 

Just write the bytes to the stream

Parameters

integer $bytes