\Swift_ByteStream_ArrayByteStream
Allows reading and writing of bytes to and from an array.
- Author: Chris Corbyn
Synopsis
class Swift_ByteStream_ArrayByteStream
implements
Swift_InputByteStream,Swift_OutputByteStream
{
- // members
- private array $_array;
- private integer $_arraySize;
- private integer $_offset;
- private array $_mirrors;
- // methods
- public void __construct()
- public string read()
- public void write()
- public void commit()
- public void bind()
- public void unbind()
- public boolean setReadPointer()
- public void flushBuffers()
Hierarchy
Implements
Members
private
- $_array
—
array
The internal stack of bytes. - $_arraySize
—
integer
The size of the stack - $_mirrors
—
array
Bound streams. - $_offset
—
integer
The internal pointer offset.
Methods
public
- __construct() — Create a new ArrayByteStream.
- bind() — Attach $is to this stream.
- commit() — Not used.
- flushBuffers() — Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
- read() — Reads $length bytes from the stream into a string and moves the pointer through the stream by $length.
- setReadPointer() — Move the internal read pointer to $byteOffset in the stream.
- unbind() — Remove an already bound stream.
- write() — Writes $bytes to the end of the stream.