Documentation

Swift_CharacterStream_ArrayCharacterStream
in package
implements Swift_CharacterStream

A CharacterStream implementation which stores characters in an internal array.

Tags
author

Chris Corbyn

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

$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

Methods

flushContents()

Empty the stream and reset the internal pointer.

public flushContents() : mixed
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>

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

reloadBuffer()

private reloadBuffer(mixed $fp, mixed $len) : mixed
Parameters
$fp : mixed
$len : mixed
Return values
mixed

Search results