An abstract means of reading and writing data in terms of characters as opposed to bytes.

Classes implementing this interface may use a subsystem which requires less memory than working with large strings of data.

package Swift
subpackage CharacterStream
author Chris Corbyn

 Methods

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