A lazy character sequence that reads from a Reader on demand.
This class is useful for tokenizing large files without loading them entirely into memory. It buffers characters as they are accessed and can efficiently skip over processed characters.
Value parameters
- reader
-
the underlying Reader to read from
- size
-
the total size of the input (if known)
Attributes
- Companion
- object
- Experimental
- true
- Source
- LazyReader.scala
- Graph
-
- Supertypes
-
trait Closeabletrait AutoCloseabletrait CharSequenceclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Gets the character at the specified position.
Gets the character at the specified position.
This will read from the underlying Reader if necessary.
Value parameters
- pos
-
the position (0-based)
Attributes
- Returns
-
the character at that position
- Throws
-
IndexOutOfBoundsException
if the position is beyond the end of input
- Source
- LazyReader.scala
Attributes
- Definition Classes
-
Closeable -> AutoCloseable
- Source
- LazyReader.scala
Skips the first count characters.
Skips the first count characters.
This is used to advance past tokens that have been processed. Uses O(1) logical offset advancement instead of O(n) buffer shifting. Periodically compacts the buffer when offset exceeds 64KB to bound memory waste.
Value parameters
- count
-
the number of characters to skip
Attributes
- Returns
-
this LazyReader for chaining
- Source
- LazyReader.scala
Gets the length of the input.
Gets the length of the input.
Attributes
- Returns
-
the length, capped at Int.MaxValue
- Source
- LazyReader.scala
Creates a subsequence.
Creates a subsequence.
Value parameters
- end
-
the end position (exclusive)
- start
-
the start position (inclusive)
Attributes
- Returns
-
a string containing the subsequence
- Source
- LazyReader.scala
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
CharSequence -> Any
- Source
- LazyReader.scala
Inherited methods
Attributes
- Inherited from:
- CharSequence
Attributes
- Inherited from:
- CharSequence
Attributes
- Inherited from:
- CharSequence
