A CharacterStream implementation which stores characters in an internal array.

package Swift
subpackage CharacterStream
author Chris Corbyn

 Methods

Create a new CharacterStream with the given $chars, if set.

__construct(\Swift_CharacterReaderFactory $factory, string $charset) 

Parameters

$factory

\Swift_CharacterReaderFactory

for loading validators

$charset

string

used in the stream

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) 

Parameters

$os

\Swift_OutputByteStream

output stream to read from

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

importString(string $string) 

Parameters

$string

string

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

read(int $length) : string

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[]

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) 

Parameters

$charOffset

int

Write $chars to the end of the stream.

write(string $chars) 

Parameters

$chars

string

_initializeMaps()

_initializeMaps() 
Static

_reloadBuffer()

_reloadBuffer($fp, $len) 

Parameters

$fp

$len

 Properties

 

$_array 
 

$_array_size 
 

$_byteMap 
 

$_charMap 
 

$_charReader 
 

$_charReaderFactory 
 

$_charset 
 

$_offset