A data structure that supports efficient access to a read-only sequence of characters. It is not thread-safe.
Constructor | Description | ||
Full Usage:
CharStream(reader, ?leaveOpen, ?bufferSize)
Parameters:
TextReader
-
The text reader to read characters from.
?leaveOpen : bool
-
Whether to keep the underlying text reader
open when the character stream gets disposed.
?bufferSize : int
-
The size of the stream's
internal character buffer. It has a default value.
Returns: CharStream
|
|
||
|
|||
|
Instance member | Description | ||
Full Usage:
this.AdvanceBy
Parameters:
int
|
Advances the stream's current position by count characters. This function invalidates the indices for the stream's CharacterBuffer and the characters that were advanced might later be released from memory. Both Windows line ending chatacters must be advanced at the same time, otherwise the stream's current position will be incorrect.
|
||
|
A read-only span of characters that contains all available characters at and after the stream's current position.
|
||
|
The position of the next character the stream has to read.
|
||
|
Returns the position of the character at ofs characters after the current position.
|
||
|
|
||
Full Usage:
this.TryExpandPastOffset
Parameters:
int
Returns: bool
|
Tries to load the ofsth character after the stream's current position. If it does not exist, returns false. This function invalidates the stream's CharacterBuffer but keeps the indices of the new buffer valid.
|