SyncReader
Attributes
- Source
- Reader.scala
- Graph
-
- Supertypes
- Known subtypes
-
class SyncInterpreter
- Self type
-
SyncReader[Elem]
Members list
Value members
Abstract methods
Signals close from the consumer side. Implementations should set internal closed state and wake any blocked readers.
Signals close from the consumer side. Implementations should set internal closed state and wake any blocked readers.
Attributes
- Source
- Reader.scala
true once the reader is closed. Reflects the state machine; does not imply the buffer is empty.
true once the reader is closed. Reflects the state machine; does not imply the buffer is empty.
Attributes
- Source
- Reader.scala
Reads the next element, or returns sentinel if the stream is closed. The caller passes a sentinel value that can never appear as a real element; getting it back means the stream is exhausted.
Reads the next element, or returns sentinel if the stream is closed. The caller passes a sentinel value that can never appear as a real element; getting it back means the stream is exhausted.
Attributes
- Source
- Reader.scala
Concrete methods
Attributes
- Source
- Reader.scala
Alias for concat.
Attributes
- Source
- Reader.scala
Attributes
- Definition Classes
- Source
- Reader.scala
Attributes
- Source
- Reader.scala
Fails immediately with a trusted typed source error.
The primitive type of elements in this reader, or AnyRef for reference types. Specialized subclasses override this to enable zero-boxing pull paths via readIntPhysical(), readLongPhysical(), etc.
The primitive type of elements in this reader, or AnyRef for reference types. Specialized subclasses override this to enable zero-boxing pull paths via readIntPhysical(), readLongPhysical(), etc.
Attributes
- Definition Classes
- Source
- Reader.scala
Drains this reader into a Chunk, consuming all remaining elements. Returns Chunk.empty when already at EOF. Dispatches on jvmType for zero-boxing on primitive streams.
Drains this reader into a Chunk, consuming all remaining elements. Returns Chunk.empty when already at EOF. Dispatches on jvmType for zero-boxing on primitive streams.
Attributes
- Source
- Reader.scala
Sentinel-return Boolean pull. Returns 1 for true, 0 for false, or sentinel when closed and empty. Sentinel must be outside [0, 1]. A typical sentinel is -1. Requires implicit evidence that Elem is a subtype of Boolean.
Sentinel-return Boolean pull. Returns 1 for true, 0 for false, or sentinel when closed and empty. Sentinel must be outside [0, 1]. A typical sentinel is -1. Requires implicit evidence that Elem is a subtype of Boolean.
Attributes
- Source
- Reader.scala
Reads a single byte, returning -1 when closed. Default delegates to read and extracts the low byte. Byte-specialized readers override for efficiency.
Reads a single byte, returning -1 when closed. Default delegates to read and extracts the low byte. Byte-specialized readers override for efficiency.
Attributes
- Source
- Reader.scala
Box-free bulk byte pull into a caller-supplied buffer. Requires compile-time evidence that this reader's element type is Byte.
Box-free bulk byte pull into a caller-supplied buffer. Requires compile-time evidence that this reader's element type is Byte.
Contract mirrors java.io.InputStream.read(byte[], int, int):
- Blocks until at least 1 byte is available.
- Returns the number of bytes read (`1 0) process(buf, 0, n) }}}
Attributes
- Source
- Reader.scala
Sentinel-return Char pull. Returns element widened to Int, or sentinel when closed. Requires implicit evidence that Elem is a subtype of Char.
Sentinel-return Char pull. Returns element widened to Int, or sentinel when closed. Requires implicit evidence that Elem is a subtype of Char.
Attributes
- Source
- Reader.scala
Sentinel-return Double pull. Returns element widened/exact, or sentinel when closed. Requires implicit evidence that Elem is a subtype of Double.
Sentinel-return Double pull. Returns element widened/exact, or sentinel when closed. Requires implicit evidence that Elem is a subtype of Double.
Attributes
- Source
- Reader.scala
Box-free bulk Double pull into a caller-supplied buffer.
Box-free bulk Double pull into a caller-supplied buffer.
Contract mirrors readBytes:
- Blocks until at least 1 element is available.
- Returns the number of elements read (
1 <= r <= maxLen). - Returns
-1when closed and empty. - Returns
0immediately whenmaxLen == 0.
Value parameters
- buf
-
destination array
- maxLen
-
maximum number of elements to read
- offset
-
starting position in
buf
Attributes
- Returns
-
number of elements read,
-1on end-of-stream, or0whenmaxLen == 0 - Source
- Reader.scala
Sentinel-return Float pull. Returns element widened to Double, or sentinel when closed. Requires implicit evidence that Elem is a subtype of Float.
Sentinel-return Float pull. Returns element widened to Double, or sentinel when closed. Requires implicit evidence that Elem is a subtype of Float.
Attributes
- Source
- Reader.scala
Box-free bulk Float pull into a caller-supplied buffer.
Box-free bulk Float pull into a caller-supplied buffer.
Contract mirrors readBytes:
- Blocks until at least 1 element is available.
- Returns the number of elements read (
1 <= r <= maxLen). - Returns
-1when closed and empty. - Returns
0immediately whenmaxLen == 0.
Value parameters
- buf
-
destination array
- maxLen
-
maximum number of elements to read
- offset
-
starting position in
buf
Attributes
- Returns
-
number of elements read,
-1on end-of-stream, or0whenmaxLen == 0 - Source
- Reader.scala
Sentinel-return Int pull. Returns the element widened to Long, or sentinel when closed and empty. The sentinel must lie outside [Int.MinValue, Int.MaxValue] (e.g. Long.MinValue). Requires implicit evidence that Elem is a subtype of Int.
Sentinel-return Int pull. Returns the element widened to Long, or sentinel when closed and empty. The sentinel must lie outside [Int.MinValue, Int.MaxValue] (e.g. Long.MinValue). Requires implicit evidence that Elem is a subtype of Int.
Attributes
- Source
- Reader.scala
Box-free bulk Int pull into a caller-supplied buffer.
Box-free bulk Int pull into a caller-supplied buffer.
Contract mirrors readBytes:
- Blocks until at least 1 element is available.
- Returns the number of elements read (
1 <= r <= maxLen). - Returns
-1when closed and empty. - Returns
0immediately whenmaxLen == 0.
Value parameters
- buf
-
destination array
- maxLen
-
maximum number of elements to read
- offset
-
starting position in
buf
Attributes
- Returns
-
number of elements read,
-1on end-of-stream, or0whenmaxLen == 0 - Source
- Reader.scala
Sentinel-return Long pull. Returns the element, or sentinel when closed and empty. The sentinel must be a value that never appears in the stream (e.g. Long.MaxValue). Requires implicit evidence that Elem is a subtype of Long.
Sentinel-return Long pull. Returns the element, or sentinel when closed and empty. The sentinel must be a value that never appears in the stream (e.g. Long.MaxValue). Requires implicit evidence that Elem is a subtype of Long.
Attributes
- Source
- Reader.scala
Box-free bulk Long pull into a caller-supplied buffer.
Box-free bulk Long pull into a caller-supplied buffer.
Contract mirrors readBytes:
- Blocks until at least 1 element is available.
- Returns the number of elements read (
1 <= r <= maxLen). - Returns
-1when closed and empty. - Returns
0immediately whenmaxLen == 0.
Value parameters
- buf
-
destination array
- maxLen
-
maximum number of elements to read
- offset
-
starting position in
buf
Attributes
- Returns
-
number of elements read,
-1on end-of-stream, or0whenmaxLen == 0 - Source
- Reader.scala
Reads at most n elements into a Chunk, returning early if the reader is exhausted. Returns Chunk.empty when n <= 0 or the reader is already closed. Dispatches on jvmType for zero-boxing on primitive streams.
Reads at most n elements into a Chunk, returning early if the reader is exhausted. Returns Chunk.empty when n <= 0 or the reader is already closed. Dispatches on jvmType for zero-boxing on primitive streams.
Attributes
- Source
- Reader.scala
Sentinel-return Short pull. Returns element widened to Int, or sentinel when closed. Requires implicit evidence that Elem is a subtype of Short.
Sentinel-return Short pull. Returns element widened to Int, or sentinel when closed. Requires implicit evidence that Elem is a subtype of Short.
Attributes
- Source
- Reader.scala
Reads up to n elements that are currently available. Blocks for at least 1 element if none are ready yet. Returns fewer than n if fewer are available without additional blocking. Returns Chunk.empty if n <= 0 or if the reader is closed and empty.
Reads up to n elements that are currently available. Blocks for at least 1 element if none are ready yet. Returns fewer than n if fewer are available without additional blocking. Returns Chunk.empty if n <= 0 or if the reader is closed and empty.
Differs from readN in that readN blocks until exactly n elements have been read. readUpToN returns as soon as at least one element is read, without waiting for further elements.
Value parameters
- n
-
maximum number of elements to read
Attributes
- Returns
-
a Chunk with between 1 and
nelements, or empty on EOS - Source
- Reader.scala
Returns true if the next read() / readIntPhysical() etc. would return a value (not closed/sentinel). Default implementation returns !isClosed. Subclasses with buffered state should override for accuracy.
Returns true if the next read() / readIntPhysical() etc. would return a value (not closed/sentinel). Default implementation returns !isClosed. Subclasses with buffered state should override for accuracy.
Attributes
- Source
- Reader.scala
Rewinds this reader to its initial state, as if freshly constructed. After reset(), all elements are available again from the beginning.
Rewinds this reader to its initial state, as if freshly constructed. After reset(), all elements are available again from the beginning.
Not all readers support this. Readers backed by one-shot resources (InputStreams, java.io.Readers) throw UnsupportedOperationException.
Attributes
- Source
- Reader.scala
Attempts to set a limit on this reader so it produces at most n elements. Returns true if the reader handled it natively (O(1), zero per-element cost), false if it cannot. When true, the reader will produce at most limit elements before reporting closed. After reset(), the limit is re-applied from the new start position.
Attempts to set a limit on this reader so it produces at most n elements. Returns true if the reader handled it natively (O(1), zero per-element cost), false if it cannot. When true, the reader will produce at most limit elements before reporting closed. After reset(), the limit is re-applied from the new start position.
Default returns false — most readers don't support native pushdown.
Attributes
- Source
- Reader.scala
Attempts to set this reader into repeat-forever mode, so it restarts from the beginning whenever it would otherwise close. Returns true if the reader handled it natively, false if the caller must wrap in a repeating wrapper.
Attempts to set this reader into repeat-forever mode, so it restarts from the beginning whenever it would otherwise close. Returns true if the reader handled it natively, false if the caller must wrap in a repeating wrapper.
Default returns false.
Attributes
- Source
- Reader.scala
Attempts to set a skip (drop) on this reader. Returns true if the reader handled it natively (O(1), zero per-element cost), false if it cannot. When true, the next skip elements will be skipped before producing. After reset(), the skip is re-applied.
Attempts to set a skip (drop) on this reader. Returns true if the reader handled it natively (O(1), zero per-element cost), false if it cannot. When true, the next skip elements will be skipped before producing. After reset(), the skip is re-applied.
Default returns false — most readers don't support native pushdown.
Attributes
- Source
- Reader.scala
Eagerly discards the first n elements. Returns Unit. If the stream closes before n elements, returns early. Subclasses should override for efficient skipping (e.g. index advancement).
Eagerly discards the first n elements. Returns Unit. If the stream closes before n elements, returns early. Subclasses should override for efficient skipping (e.g. index advancement).
Attributes
- Source
- Reader.scala
Constructs a trusted typed source failure for custom Reader implementations.
Constructs a trusted typed source failure for custom Reader implementations.
Attributes
- Source
- Reader.scala
Attributes
- Source
- Reader.scala
Wraps this reader so that release runs after close().
Wraps this reader so that release runs after close().
Value parameters
- release
-
Action to execute when this reader is closed.
Attributes
- Source
- Reader.scala
Attributes
- Source
- Reader.scala