A CharacterStream implementation which stores characters in an internal array.

package Swift
subpackage CharacterStream
author Xavier De Cock

 Methods

The constructor

__construct(\Swift_CharacterReaderFactory $factory, \unknown_type $charset) 

Parameters

$charset

\unknown_type

Empty the stream and reset the internal pointer.

flushContents() 

Overwrite this character stream using the byte sequence in the byte stream.

importByteStream(\Swift_OutputByteStream $os) 

Import a string a bytes into this CharacterStream, overwriting any existing data in the stream.

importString(string $string) 
see \Swift_CharacterStream::importString()

Parameters

$string

string

Read $length characters from the stream and move the internal pointer $length further into the stream.

read(int $length) : string
see \Swift_CharacterStream::read()

Parameters

$length

int

Returns

string

Read $length characters from the stream and return a 1-dimensional array containing there octet values.

readBytes(int $length) : int[]
see \Swift_CharacterStream::readBytes()

Parameters

$length

int

Returns

int[]

Set the CharacterReaderFactory for multi charset support.

setCharacterReaderFactory(\Swift_CharacterReaderFactory $factory) 

Parameters

Set the character set used in this CharacterStream.

setCharacterSet(string $charset) 

Parameters

$charset

string

Move the internal pointer to $charOffset in the stream.

setPointer(int $charOffset) 
see \Swift_CharacterStream::setPointer()

Parameters

$charOffset

int

Write $chars to the end of the stream.

write(string $chars) 
see \Swift_CharacterStream::write()

Parameters

$chars

string

 Properties

 

$_charCount : int
 

$_charReader : \Swift_CharacterReader
access private
 

$_charReaderFactory : \Swift_CharacterReaderFactory
access private
 

$_charset : string
access private
 

$_currentPos : \unknown_type
 

$_datas : string
 

$_datasSize : int
 

$_map : mixed
 

$_mapType : int