MemoryBuffer implements Transport
A memory buffer is a transport 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.
Interfaces
Methods
- __construct() : mixed
- Constructor. Optionally pass an initial value for the buffer.
- available() : int
- close() : void
- data() : string
- isOpen() : bool
- open() : void
- read() : string
- write() : void
Methods
__construct()
Constructor. Optionally pass an initial value for the buffer.
public
__construct([string $data = '' ]) : mixed
Parameters
- $data : string = ''
available()
public
available() : int
Return values
intclose()
public
close() : void
data()
public
data() : string
Return values
stringisOpen()
public
isOpen() : bool
Return values
boolopen()
public
open() : void
read()
public
read(int $len) : string
Parameters
- $len : int
Return values
stringwrite()
public
write(string $buf) : void
Parameters
- $buf : string