PHP Class Swift_Transport_StreamBuffer, Halite

Author: Chris Corbyn
Inheritance: extends Swift_ByteStream_AbstractFilterableInputStream, implements Swift_Transport_IoBuffer
Show file Open project: HaliteChallenge/Halite

Public Methods

Method Description
__construct ( Swift_ReplacementFilterFactory $replacementFactory ) Create a new StreamBuffer using $replacementFactory for transformations.
initialize ( array $params ) Perform any initialization needed, using the given $params.
read ( integer $length ) : string | boolean Reads $length bytes from the stream into a string and moves the pointer through the stream by $length.
readLine ( integer $sequence ) : string Get a line of output (including any CRLF).
setParam ( string $param, mixed $value ) Set an individual param on the buffer (e.g. switching to SSL).
setReadPointer ( $byteOffset ) Not implemented
setWriteTranslations ( array $replacements ) Set an array of string replacements which should be made on data written to the buffer.
startTLS ( )
terminate ( ) Perform any shutdown logic needed.

Protected Methods

Method Description
_commit ( $bytes ) Write this bytes to the stream
_flush ( ) Flush the stream contents

Private Methods

Method Description
_establishProcessConnection ( ) Opens a process for input/output.
_establishSocketConnection ( ) Establishes a connection to a remote server.
_getReadConnectionDescription ( )

Method Details

__construct() public method

Create a new StreamBuffer using $replacementFactory for transformations.
public __construct ( Swift_ReplacementFilterFactory $replacementFactory )
$replacementFactory Swift_ReplacementFilterFactory

_commit() protected method

Write this bytes to the stream
protected _commit ( $bytes )

_flush() protected method

Flush the stream contents
protected _flush ( )

initialize() public method

Parameters will vary depending upon the type of IoBuffer used.
public initialize ( array $params )
$params array

read() public method

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 read ( integer $length ) : string | boolean
$length integer
return string | boolean

readLine() public method

The $sequence number comes from any writes and may or may not be used depending upon the implementation.
public readLine ( integer $sequence ) : string
$sequence integer of last write to scan from
return string

setParam() public method

Set an individual param on the buffer (e.g. switching to SSL).
public setParam ( string $param, mixed $value )
$param string
$value mixed

setReadPointer() public method

Not implemented
public setReadPointer ( $byteOffset )

setWriteTranslations() public method

This could replace LF with CRLF for example.
public setWriteTranslations ( array $replacements )
$replacements array

startTLS() public method

public startTLS ( )

terminate() public method

Perform any shutdown logic needed.
public terminate ( )