Interface Swift_Transport_IoBuffer
Extends | Swift_InputByteStream, Swift_OutputByteStream |
---|---|
Implemented by | Swift_Transport_StreamBuffer |
Buffers input and output to a resource.
Public Methods
Method | Description | Defined By |
---|---|---|
bind() | Attach $is to this stream. | Swift_InputByteStream |
commit() | For any bytes that are currently buffered inside the stream, force them off the buffer. | Swift_InputByteStream |
flushBuffers() | Flush the contents of the stream (empty it) and set the internal pointer to the beginning. | Swift_InputByteStream |
initialize() | Perform any initialization needed, using the given $params. | Swift_Transport_IoBuffer |
read() | Reads $length bytes from the stream into a string and moves the pointer through the stream by $length. | Swift_OutputByteStream |
readLine() | Get a line of output (including any CRLF). | Swift_Transport_IoBuffer |
setParam() | Set an individual param on the buffer (e.g. switching to SSL). | Swift_Transport_IoBuffer |
setReadPointer() | Move the internal read pointer to $byteOffset in the stream. | Swift_OutputByteStream |
setWriteTranslations() | Set an array of string replacements which should be made on data written to the buffer. | Swift_Transport_IoBuffer |
terminate() | Perform any shutdown logic needed. | Swift_Transport_IoBuffer |
unbind() | Remove an already bound stream. | Swift_InputByteStream |
write() | Writes $bytes to the end of the stream. | Swift_InputByteStream |
Method Details
Perform any initialization needed, using the given $params.
Parameters will vary depending upon the type of IoBuffer used.
public abstract void initialize ( array $params ) | ||
$params | array |
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 abstract string readLine ( $sequence ) | ||
$sequence | int | Of last write to scan from |
Set an individual param on the buffer (e.g. switching to SSL).
public abstract void setParam ( $param, $value ) | ||
$param | string | |
$value | mixed |
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 abstract void setWriteTranslations ( array $replacements ) | ||
$replacements | string[] |
Perform any shutdown logic needed.
public abstract void terminate ( ) |