\Swift_CharacterStream_ArrayCharacterStream
A CharacterStream implementation which stores characters in an internal array.
- Author: Chris Corbyn
Synopsis
class Swift_CharacterStream_ArrayCharacterStream
implements
Swift_CharacterStream
{
- // members
- private $_charMap;
- private $_byteMap;
- private $_charReader;
- private $_charReaderFactory;
- private $_charset;
- private array $_array;
- private array $_array_size;
- private integer $_offset;
- // methods
- public void __construct()
- public void setCharacterSet()
- public void setCharacterReaderFactory()
- public void importByteStream()
- public void importString()
- public string read()
- public array readBytes()
- public void write()
- public void setPointer()
- public void flushContents()
- private void _reloadBuffer()
- private static void _initializeMaps()
Hierarchy
Implements
Members
private
-
$_array
Array of characters -
$_array_size
Size of the array of character -
$_byteMap
A map of characters and their derivative byte values -
$_charMap
A map of byte values and their respective characters -
$_charReader
The char reader (lazy-loaded) for the current charset -
$_charReaderFactory
A factory for creating CharacterReader instances -
$_charset
The character set this stream is using -
$_offset
The current character offset in the stream
Methods
private
public
- __construct() — Create a new CharacterStream with the given $chars, if set.
- flushContents() — Empty the stream and reset the internal pointer.
- importByteStream() — Overwrite this character stream using the byte sequence in the byte stream.
- importString() — Import a string a bytes into this CharacterStream, overwriting any existing data in the stream.
- read() — Read $length characters from the stream and move the internal pointer $length further into the stream.
- readBytes() — Read $length characters from the stream and return a 1-dimensional array containing there octet values.
- setCharacterReaderFactory() — Set the CharacterReaderFactory for multi charset support.
- setCharacterSet() — Set the character set used in this CharacterStream.
- setPointer() — Move the internal pointer to $charOffset in the stream.
- write() — Write $chars to the end of the stream.