Swift_CharacterStream_NgCharacterStream
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
- $charCount : int
- Number of characters in the stream.
- $charReader : Swift_CharacterReader
- The char reader (lazy-loaded) for the current charset.
- $charReaderFactory : Swift_CharacterReaderFactory
- A factory for creating CharacterReader instances.
- $charset : string
- The character set this stream is using.
- $currentPos : int
- Position in the stream.
- $datas : string
- The data's stored as-is.
- $datasSize : int
- Number of bytes in the stream.
- $map : mixed
- Map.
- $mapType : int
- Map Type.
- __construct() : mixed
- Constructor.
- 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.
Properties
$charCount
Number of characters in the stream.
private
int
$charCount
= 0
$charReader
The char reader (lazy-loaded) for the current charset.
private
Swift_CharacterReader
$charReader
$charReaderFactory
A factory for creating CharacterReader instances.
private
Swift_CharacterReaderFactory
$charReaderFactory
$charset
The character set this stream is using.
private
string
$charset
$currentPos
Position in the stream.
private
int
$currentPos
= 0
$datas
The data's stored as-is.
private
string
$datas
= ''
$datasSize
Number of bytes in the stream.
private
int
$datasSize
= 0
$map
Map.
private
mixed
$map
$mapType
Map Type.
private
int
$mapType
= 0
Methods
__construct()
Constructor.
public
__construct(Swift_CharacterReaderFactory $factory, string $charset) : mixed
Parameters
- $factory : Swift_CharacterReaderFactory
- $charset : string
Return values
mixed —flushContents()
Empty the stream and reset the internal pointer.
public
flushContents() : mixed
Tags
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
Tags
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
Tags
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
Tags
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
Tags
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
Tags
Return values
mixed —write()
Write $chars to the end of the stream.
public
write(string $chars) : mixed
Parameters
- $chars : string