\TMemoryBuffer

A memory buffer is a tranpsort that simply reads from and writes to an in-memory string buffer. Anytime you call write on it, the data is simply placed into a buffer, and anytime you call read, data is read from that buffer.

Summary

Methods
Properties
Constants
isOpen()
open()
close()
read()
readAll()
write()
flush()
__construct()
getBuffer()
available()
No public properties found
No constants found
No protected methods found
$buf_
N/A
No private methods found
No private properties found
N/A

Properties

$buf_

$buf_ : 

Type

Methods

isOpen()

isOpen() : boolean

Whether this transport is open.

Returns

boolean —

true if open

open()

open() 

Open the transport for reading/writing

close()

close() 

Close the transport.

read()

read(integer  $len) : string

Read some data into the array.

Parameters

integer $len

How much to read

Returns

string —

The data that has been read

readAll()

readAll(  $len) : string

Guarantees that the full amount of data is read.

Parameters

$len

Throws

\TTransportException

if cannot read data

Returns

string —

The data, of exact length

write()

write(string  $buf) 

Writes the given data out.

Parameters

string $buf

The data to write

flush()

flush() 

Flushes any pending data out of a buffer

Throws

\TTransportException

if a writing error occurs

__construct()

__construct(  $buf = '') 

Constructor. Optionally pass an initial value for the buffer.

Parameters

$buf

getBuffer()

getBuffer() 

available()

available()