Swift_Transport_StreamBuffer
extends Swift_ByteStream_AbstractFilterableInputStream
in package
implements
Swift_Transport_IoBuffer
A generic IoBuffer implementation supporting remote sockets and local processes.
Tags
Interfaces, Classes and Traits
- Swift_Transport_IoBuffer
- Buffers input and output to a resource.
Table of Contents
- $sequence : mixed
- Write sequence.
- $filters : array<string|int, Swift_StreamFilter>
- StreamFilters.
- $in : mixed
- The input stream
- $mirrors : array<string|int, Swift_InputByteStream>
- Bound streams.
- $out : mixed
- The output stream
- $params : mixed
- Buffer initialization parameters
- $replacementFactory : mixed
- The ReplacementFilterFactory
- $stream : mixed
- A primary socket
- $translations : mixed
- Translations performed on data being streamed into the buffer
- $writeBuffer : mixed
- A buffer for writing.
- __construct() : mixed
- Create a new StreamBuffer using $replacementFactory for transformations.
- addFilter() : mixed
- Add a StreamFilter to this InputByteStream.
- bind() : mixed
- Attach $is to this stream.
- commit() : mixed
- For any bytes that are currently buffered inside the stream, force them off the buffer.
- flushBuffers() : mixed
- Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
- initialize() : mixed
- Perform any initialization needed, using the given $params.
- read() : string|bool
- Reads $length bytes from the stream into a string and moves the pointer through the stream by $length.
- readLine() : string
- Get a line of output (including any CRLF).
- removeFilter() : mixed
- Remove an already present StreamFilter based on its $key.
- setParam() : mixed
- Set an individual param on the buffer (e.g. switching to SSL).
- setReadPointer() : mixed
- Not implemented
- setWriteTranslations() : mixed
- Set an array of string replacements which should be made on data written to the buffer.
- startTLS() : mixed
- terminate() : mixed
- Perform any shutdown logic needed.
- unbind() : mixed
- Remove an already bound stream.
- write() : int
- Writes $bytes to the end of the stream.
- doCommit() : mixed
- Write this bytes to the stream
- flush() : mixed
- Flush the stream contents
- doWrite() : mixed
- Just write the bytes to the stream
- establishProcessConnection() : mixed
- Opens a process for input/output.
- establishSocketConnection() : mixed
- Establishes a connection to a remote server.
- filter() : mixed
- Run $bytes through all filters
- getReadConnectionDescription() : mixed
Properties
$sequence
Write sequence.
protected
mixed
$sequence
= 0
$filters
StreamFilters.
private
array<string|int, Swift_StreamFilter>
$filters
= []
$in
The input stream
private
mixed
$in
$mirrors
Bound streams.
private
array<string|int, Swift_InputByteStream>
$mirrors
= []
$out
The output stream
private
mixed
$out
$params
Buffer initialization parameters
private
mixed
$params
= []
$replacementFactory
The ReplacementFilterFactory
private
mixed
$replacementFactory
$stream
A primary socket
private
mixed
$stream
$translations
Translations performed on data being streamed into the buffer
private
mixed
$translations
= []
$writeBuffer
A buffer for writing.
private
mixed
$writeBuffer
= ''
Methods
__construct()
Create a new StreamBuffer using $replacementFactory for transformations.
public
__construct(Swift_ReplacementFilterFactory $replacementFactory) : mixed
Parameters
- $replacementFactory : Swift_ReplacementFilterFactory
Return values
mixed —addFilter()
Add a StreamFilter to this InputByteStream.
public
addFilter(Swift_StreamFilter $filter, string $key) : mixed
Parameters
- $filter : Swift_StreamFilter
- $key : string
Return values
mixed —bind()
Attach $is to this stream.
public
bind(Swift_InputByteStream $is) : mixed
The stream acts as an observer, receiving all data that is written. All and operations will be mirrored.
Parameters
- $is : Swift_InputByteStream
Return values
mixed —commit()
For any bytes that are currently buffered inside the stream, force them off the buffer.
public
commit() : mixed
Tags
Return values
mixed —flushBuffers()
Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
public
flushBuffers() : mixed
Tags
Return values
mixed —initialize()
Perform any initialization needed, using the given $params.
public
initialize(array<string|int, mixed> $params) : mixed
Parameters will vary depending upon the type of IoBuffer used.
Parameters
- $params : array<string|int, mixed>
Return values
mixed —read()
Reads $length bytes from the stream into a string and moves the pointer through the stream by $length.
public
read(int $length) : string|bool
If less bytes exist than are requested the remaining bytes are given instead. If no bytes are remaining at all, boolean false is returned.
Parameters
- $length : int
Tags
Return values
string|bool —readLine()
Get a line of output (including any CRLF).
public
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
Tags
Return values
string —removeFilter()
Remove an already present StreamFilter based on its $key.
public
removeFilter(string $key) : mixed
Parameters
- $key : string
Return values
mixed —setParam()
Set an individual param on the buffer (e.g. switching to SSL).
public
setParam(string $param, mixed $value) : mixed
Parameters
- $param : string
- $value : mixed
Return values
mixed —setReadPointer()
Not implemented
public
setReadPointer(mixed $byteOffset) : mixed
Parameters
- $byteOffset : mixed
Return values
mixed —setWriteTranslations()
Set an array of string replacements which should be made on data written to the buffer.
public
setWriteTranslations(array<string|int, string> $replacements) : mixed
This could replace LF with CRLF for example.
Parameters
- $replacements : array<string|int, string>
Return values
mixed —startTLS()
public
startTLS() : mixed
Return values
mixed —terminate()
Perform any shutdown logic needed.
public
terminate() : mixed
Return values
mixed —unbind()
Remove an already bound stream.
public
unbind(Swift_InputByteStream $is) : mixed
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
- $is : Swift_InputByteStream
Return values
mixed —write()
Writes $bytes to the end of the stream.
public
write(string $bytes) : int
Parameters
- $bytes : string
Tags
Return values
int —doCommit()
Write this bytes to the stream
protected
doCommit(mixed $bytes) : mixed
Parameters
- $bytes : mixed
Return values
mixed —flush()
Flush the stream contents
protected
flush() : mixed
Return values
mixed —doWrite()
Just write the bytes to the stream
private
doWrite(mixed $bytes) : mixed
Parameters
- $bytes : mixed
Return values
mixed —establishProcessConnection()
Opens a process for input/output.
private
establishProcessConnection() : mixed
Return values
mixed —establishSocketConnection()
Establishes a connection to a remote server.
private
establishSocketConnection() : mixed
Return values
mixed —filter()
Run $bytes through all filters
private
filter(mixed $bytes) : mixed
Parameters
- $bytes : mixed
Return values
mixed —getReadConnectionDescription()
private
getReadConnectionDescription() : mixed