Swift_CharacterStream_ArrayCharacterStream
in package
implements
Swift_CharacterStream
A CharacterStream implementation which stores characters in an internal array.
Tags
Interfaces, Classes and Traits
- Swift_CharacterStream
- An abstract means of reading and writing data in terms of characters as opposed to bytes.
Table of Contents
- $array : mixed
- Array of characters
- $array_size : mixed
- Size of the array of character
- $byteMap : mixed
- A map of characters and their derivative byte values
- $charMap : mixed
- A map of byte values and their respective characters
- $charReader : mixed
- The char reader (lazy-loaded) for the current charset
- $charReaderFactory : mixed
- A factory for creating CharacterReader instances
- $charset : mixed
- The character set this stream is using
- $offset : mixed
- The current character offset in the stream
- __construct() : mixed
- Create a new CharacterStream with the given $chars, if set.
- flushContents() : mixed
- Empty the stream and reset the internal pointer.
- importByteStream() : mixed
- Overwrite this character stream using the byte sequence in the byte stream.
- importString() : mixed
- Import a string a bytes into this CharacterStream, overwriting any existing data in the stream.
- read() : string
- Read $length characters from the stream and move the internal pointer $length further into the stream.
- readBytes() : array<string|int, int>
- Read $length characters from the stream and return a 1-dimensional array containing there octet values.
- setCharacterReaderFactory() : mixed
- Set the CharacterReaderFactory for multi charset support.
- setCharacterSet() : mixed
- Set the character set used in this CharacterStream.
- setPointer() : mixed
- Move the internal pointer to $charOffset in the stream.
- write() : mixed
- Write $chars to the end of the stream.
- initializeMaps() : mixed
- reloadBuffer() : mixed
Properties
$array
Array of characters
private
mixed
$array
= []
$array_size
Size of the array of character
private
mixed
$array_size
= []
$byteMap
A map of characters and their derivative byte values
private
static mixed
$byteMap
$charMap
A map of byte values and their respective characters
private
static mixed
$charMap
$charReader
The char reader (lazy-loaded) for the current charset
private
mixed
$charReader
$charReaderFactory
A factory for creating CharacterReader instances
private
mixed
$charReaderFactory
$charset
The character set this stream is using
private
mixed
$charset
$offset
The current character offset in the stream
private
mixed
$offset
= 0
Methods
__construct()
Create a new CharacterStream with the given $chars, if set.
public
__construct(Swift_CharacterReaderFactory $factory, string $charset) : mixed
Parameters
- $factory : Swift_CharacterReaderFactory
-
for loading validators
- $charset : string
-
used in the stream
Return values
mixed —flushContents()
Empty the stream and reset the internal pointer.
public
flushContents() : mixed
Return values
mixed —importByteStream()
Overwrite this character stream using the byte sequence in the byte stream.
public
importByteStream(Swift_OutputByteStream $os) : mixed
Parameters
- $os : Swift_OutputByteStream
-
output stream to read from
Return values
mixed —importString()
Import a string a bytes into this CharacterStream, overwriting any existing data in the stream.
public
importString(string $string) : mixed
Parameters
- $string : string
Return values
mixed —read()
Read $length characters from the stream and move the internal pointer $length further into the stream.
public
read(int $length) : string
Parameters
- $length : int
Return values
string —readBytes()
Read $length characters from the stream and return a 1-dimensional array containing there octet values.
public
readBytes(int $length) : array<string|int, int>
Parameters
- $length : int
Return values
array<string|int, int> —setCharacterReaderFactory()
Set the CharacterReaderFactory for multi charset support.
public
setCharacterReaderFactory(Swift_CharacterReaderFactory $factory) : mixed
Parameters
- $factory : Swift_CharacterReaderFactory
Return values
mixed —setCharacterSet()
Set the character set used in this CharacterStream.
public
setCharacterSet(string $charset) : mixed
Parameters
- $charset : string
Return values
mixed —setPointer()
Move the internal pointer to $charOffset in the stream.
public
setPointer(int $charOffset) : mixed
Parameters
- $charOffset : int
Return values
mixed —write()
Write $chars to the end of the stream.
public
write(string $chars) : mixed
Parameters
- $chars : string
Return values
mixed —initializeMaps()
private
static initializeMaps() : mixed
Return values
mixed —reloadBuffer()
private
reloadBuffer(mixed $fp, mixed $len) : mixed
Parameters
- $fp : mixed
- $len : mixed