Allows reading and writing of bytes to and from an array.
package | Swift |
---|---|
subpackage | ByteStream |
author | Chris Corbyn |
__construct(mixed $stack)
If $stack is given the stream will be populated with the bytes it contains.
mixed
of bytes in string or array form, optional
bind(\Swift_InputByteStream $is)
The stream acts as an observer, receiving all data that is written. All write() and flushBuffers() operations will be mirrored.
flushBuffers()
\Swift_IoException |
---|
read(int $length) : string
If less bytes exist than are requested the remaining bytes are given instead. If no bytes are remaining at all, boolean false is returned.
int
\Swift_IoException |
---|
string
setReadPointer(int $byteOffset) : boolean
unbind(\Swift_InputByteStream $is)
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.
write(string $bytes) : int
Writing may not happen immediately if the stream chooses to buffer. If you want to write these bytes with immediate effect, call commit() after calling write().
This method returns the sequence ID of the write (i.e. 1 for first, 2 for second, etc etc).
string
\Swift_IoException |
---|
int
$_array : string[]
access | private |
---|
$_arraySize : int
access | private |
---|
$_mirrors
$_offset : int
access | private |
---|