Reader

zio.blocks.streams.io.Reader
See theReader companion class
object Reader

Attributes

Companion
class
Source
Reader.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Reader.type

Members list

Type members

Classlikes

abstract class AsyncReader[+Elem] extends Reader[Elem]

A reader whose pull and lifecycle operations may suspend.

A reader whose pull and lifecycle operations may suspend.

Attributes

Source
Reader.scala
Supertypes
class Reader[Elem]
class Object
trait Matchable
class Any
Self type
AsyncReader[Elem]
abstract class SyncReader[+Elem] extends Reader[Elem]

Attributes

Source
Reader.scala
Supertypes
class Reader[Elem]
class Object
trait Matchable
class Any
Known subtypes
Self type
SyncReader[Elem]

Value members

Concrete methods

def closed: SyncReader[Nothing]

A reader that is already closed. read returns null; readByte returns -1. The element type is Nothing — a closed reader emits no elements and widens by covariance to any Reader[Elem].

A reader that is already closed. read returns null; readByte returns -1. The element type is Nothing — a closed reader emits no elements and widens by covariance to any Reader[Elem].

Attributes

Source
Reader.scala
def fromChunk[A](chunk: Chunk[A])(implicit jt: Infer[A]): SyncReader[A]

A reader backed by a zio.blocks.chunk.Chunk. Emits all elements in index order, then closes. No virtual thread or queue needed.

A reader backed by a zio.blocks.chunk.Chunk. Emits all elements in index order, then closes. No virtual thread or queue needed.

Attributes

Source
Reader.scala

Wraps a java.io.InputStream as a Reader[Byte].

Wraps a java.io.InputStream as a Reader[Byte].

Attributes

Source
Reader.scala
def fromIterable[A](it: Iterable[A])(implicit jt: Infer[A]): SyncReader[A]

A reader backed by an Iterable. Emits all elements in iteration order, then closes. No virtual thread or queue needed.

A reader backed by an Iterable. Emits all elements in iteration order, then closes. No virtual thread or queue needed.

Attributes

Source
Reader.scala
def fromRange(range: Range): SyncReader[Int]

A reader backed by a Scala Range. Emits integers in range order, then closes. No virtual thread or queue needed.

A reader backed by a Scala Range. Emits integers in range order, then closes. No virtual thread or queue needed.

Attributes

Source
Reader.scala
def fromReader(r: Reader): SyncReader[Char]

Wraps a java.io.Reader as a Reader[Char].

Wraps a java.io.Reader as a Reader[Char].

Attributes

Source
Reader.scala
def repeat[A](a: A)(implicit jt: Infer[A]): SyncReader[A]

Creates an infinite reader that always emits a. The reader sets repeat mode on a single reader so it never closes.

Creates an infinite reader that always emits a. The reader sets repeat mode on a single reader so it never closes.

Attributes

Source
Reader.scala
def repeated[A](inner: SyncReader[A]): SyncReader[A]

A reader that restarts inner each time it closes cleanly. If it closes with an error (exception), the error is propagated. Used by Stream.Repeated.

A reader that restarts inner each time it closes cleanly. If it closes with an error (exception), the error is propagated. Used by Stream.Repeated.

Attributes

Source
Reader.scala
def repeated[A](inner: AsyncReader[A]): AsyncReader[A]

Asynchronous counterpart of repeated(SyncReader).

Asynchronous counterpart of repeated(SyncReader).

Attributes

Source
Reader.scala
def repeated[A](inner: Reader[A]): Reader[A]

Preserves the statically unknown reader kind at runtime.

Preserves the statically unknown reader kind at runtime.

Attributes

Source
Reader.scala
def single[A](value: A)(implicit jt: Infer[A]): SyncReader[A]

A reader that emits exactly one element then closes. Primitive types (Int, Long, Float, Double, etc.) use SingletonPrim for zero-boxing; reference types use SingletonGeneric.

A reader that emits exactly one element then closes. Primitive types (Int, Long, Float, Double, etc.) use SingletonPrim for zero-boxing; reference types use SingletonGeneric.

Attributes

Source
Reader.scala
def singleBoolean(value: Boolean): SyncReader[Boolean]

Creates a Reader that emits exactly one Boolean, zero-boxing on the read path.

Creates a Reader that emits exactly one Boolean, zero-boxing on the read path.

Attributes

Source
Reader.scala
def singleByte(value: Byte): SyncReader[Byte]

Creates a Reader that emits exactly one Byte through the Byte lane.

Creates a Reader that emits exactly one Byte through the Byte lane.

Attributes

Source
Reader.scala
def singleChar(value: Char): SyncReader[Char]

Creates a Reader that emits exactly one Char, zero-boxing on the read path.

Creates a Reader that emits exactly one Char, zero-boxing on the read path.

Attributes

Source
Reader.scala
def singleDouble(value: Double): SyncReader[Double]

Creates a Reader that emits exactly one Double, zero-boxing on the read path.

Creates a Reader that emits exactly one Double, zero-boxing on the read path.

Attributes

Source
Reader.scala
def singleFloat(value: Float): SyncReader[Float]

Creates a Reader that emits exactly one Float, zero-boxing on the read path.

Creates a Reader that emits exactly one Float, zero-boxing on the read path.

Attributes

Source
Reader.scala
def singleInt(value: Int): SyncReader[Int]

Creates a Reader that emits exactly one Int, zero-boxing on the read path.

Creates a Reader that emits exactly one Int, zero-boxing on the read path.

Attributes

Source
Reader.scala
def singleLong(value: Long): SyncReader[Long]

Creates a Reader that emits exactly one Long, zero-boxing on the read path.

Creates a Reader that emits exactly one Long, zero-boxing on the read path.

Attributes

Source
Reader.scala
def singleShort(value: Short): SyncReader[Short]

Creates a Reader that emits exactly one Short, zero-boxing on the read path.

Creates a Reader that emits exactly one Short, zero-boxing on the read path.

Attributes

Source
Reader.scala
def unfold[S, A](s: S)(f: S => Option[(A, S)])(implicit jt: Infer[A]): SyncReader[A]

A reader produced by unfolding state s with f. f returns None to signal completion, or Some((elem, nextState)) to emit an element and advance state. Closes when f returns None. No virtual thread or queue needed — read() never blocks.

A reader produced by unfolding state s with f. f returns None to signal completion, or Some((elem, nextState)) to emit an element and advance state. Closes when f returns None. No virtual thread or queue needed — read() never blocks.

Attributes

Source
Reader.scala
def unfoldAsync[S, A](s: S)(f: S => encoding.Async[Option[(A, S)]])(implicit jt: Infer[A]): AsyncReader[A]

Creates a native asynchronous Reader by unfolding state s with f. Exactly one state callback may be active. The next state is committed only when that callback succeeds while its reader generation is still current.

Creates a native asynchronous Reader by unfolding state s with f. Exactly one state callback may be active. The next state is committed only when that callback succeeds while its reader generation is still current.

Attributes

Source
Reader.scala