Class Swift_Transport_StreamBuffer

InheritanceSwift_Transport_StreamBuffer » Swift_ByteStream_AbstractFilterableInputStream
ImplementsSwift_Filterable, Swift_InputByteStream, Swift_Transport_IoBuffer

A generic IoBuffer implementation supporting remote sockets and local processes.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$_sequence Write sequence. Swift_ByteStream_AbstractFilterableInputStream

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Create a new StreamBuffer using $replacementFactory for transformations. Swift_Transport_StreamBuffer
addFilter() Add a StreamFilter to this InputByteStream. Swift_ByteStream_AbstractFilterableInputStream
bind() Attach $is to this stream. Swift_ByteStream_AbstractFilterableInputStream
commit() For any bytes that are currently buffered inside the stream, force them off the buffer. Swift_ByteStream_AbstractFilterableInputStream
flushBuffers() Flush the contents of the stream (empty it) and set the internal pointer to the beginning. Swift_ByteStream_AbstractFilterableInputStream
initialize() Perform any initialization needed, using the given $params. Swift_Transport_StreamBuffer
read() Reads $length bytes from the stream into a string and moves the pointer through the stream by $length. Swift_Transport_StreamBuffer
readLine() Get a line of output (including any CRLF). Swift_Transport_StreamBuffer
removeFilter() Remove an already present StreamFilter based on its $key. Swift_ByteStream_AbstractFilterableInputStream
setParam() Set an individual param on the buffer (e.g. switching to SSL). Swift_Transport_StreamBuffer
setReadPointer() Not implemented Swift_Transport_StreamBuffer
setWriteTranslations() Set an array of string replacements which should be made on data written to the buffer. Swift_Transport_StreamBuffer
startTLS() Swift_Transport_StreamBuffer
terminate() Perform any shutdown logic needed. Swift_Transport_StreamBuffer
unbind() Remove an already bound stream. Swift_ByteStream_AbstractFilterableInputStream
write() Writes $bytes to the end of the stream. Swift_ByteStream_AbstractFilterableInputStream

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
_commit() Write this bytes to the stream Swift_Transport_StreamBuffer
_flush() Flush the stream contents Swift_Transport_StreamBuffer

Method Details

__construct() public method

Create a new StreamBuffer using $replacementFactory for transformations.

public void __construct ( Swift_ReplacementFilterFactory $replacementFactory )
$replacementFactory Swift_ReplacementFilterFactory
_commit() protected method

Write this bytes to the stream

protected void _commit ( $bytes )
$bytes
_flush() protected method

Flush the stream contents

protected void _flush ( )
initialize() public method

Perform any initialization needed, using the given $params.

Parameters will vary depending upon the type of IoBuffer used.

public void initialize ( array $params )
$params array
read() public method

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.

public string|bool read ( $length )
$length int
throws Swift_IoException
readLine() public method

Get a line of output (including any CRLF).

The $sequence number comes from any writes and may or may not be used depending upon the implementation.

public string readLine ( $sequence )
$sequence int

Of last write to scan from

throws Swift_IoException
setParam() public method

Set an individual param on the buffer (e.g. switching to SSL).

public void setParam ( $param, $value )
$param string
$value mixed
setReadPointer() public method

Not implemented

public void setReadPointer ( $byteOffset )
$byteOffset
setWriteTranslations() public method

Set an array of string replacements which should be made on data written to the buffer.

This could replace LF with CRLF for example.

public void setWriteTranslations ( array $replacements )
$replacements string[]
startTLS() public method

public void startTLS ( )
terminate() public method

Perform any shutdown logic needed.

public void terminate ( )