Documentation

Swift_Transport_StreamBuffer extends Swift_ByteStream_AbstractFilterableInputStream
in package
implements Swift_Transport_IoBuffer

A generic IoBuffer implementation supporting remote sockets and local processes.

Tags
author

Chris Corbyn

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

$params

Buffer initialization parameters

private mixed $params = []

$replacementFactory

The ReplacementFilterFactory

private mixed $replacementFactory

$translations

Translations performed on data being streamed into the buffer

private mixed $translations = []

Methods

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
throws
Swift_IoException
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
throws
Swift_IoException
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

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
Return values
mixed

Search results