Buffers input and output to a resource.

Classes implementing this interface may use a subsystem which requires less memory than working with large strings of data.

package Swift
subpackage Transport
author Chris Corbyn

 Methods

Attach $is to this stream.

bind(\Swift_InputByteStream $is) 
Inherited

The stream acts as an observer, receiving all data that is written. All write() and flushBuffers() operations will be mirrored.

inherited_from \Swift_InputByteStream::bind()

Parameters

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

commit() 
Inherited
inherited_from \Swift_InputByteStream::commit()

Exceptions

\Swift_IoException

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

flushBuffers() 
Inherited
inherited_from \Swift_InputByteStream::flushBuffers()

Exceptions

\Swift_IoException

Perform any initialization needed, using the given $params.

initialize(array $params) 

Parameters will vary depending upon the type of IoBuffer used.

Parameters

$params

array

Get a line of output (including any CRLF).

readLine(int $sequence) : string

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

Parameters

$sequence

int

of last write to scan from

Returns

string

Set an individual param on the buffer (e.g.

setParam(string $param, mixed $value) 

switching to SSL).

Parameters

$param

string

$value

mixed

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

setWriteTranslations(array $replacements) 

This could replace LF with CRLF for example.

Parameters

$replacements

string[]

Perform any shutdown logic needed.

terminate() 

Remove an already bound stream.

unbind(\Swift_InputByteStream $is) 
Inherited

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.

inherited_from \Swift_InputByteStream::unbind()

Parameters

Writes $bytes to the end of the stream.

write(string $bytes) : int
Inherited

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).

inherited_from \Swift_InputByteStream::write()

Parameters

$bytes

string

Exceptions

\Swift_IoException

Returns

int

 Constants

 

A process buffer with I/O support

TYPE_PROCESS 
 

A socket buffer over TCP

TYPE_SOCKET