object Reader

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Reader
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def chunked(r: Reader[Buf], chunkSize: Int): Reader[Buf]

    Chunk the output of a given Reader by at most chunkSize (bytes).

    Chunk the output of a given Reader by at most chunkSize (bytes). This consumes the reader.

  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. def concat[A](readers: AsyncStream[Reader[A]]): Reader[A]

    Convenient abstraction to read from a stream (AsyncStream) of Readers as if it were a single Reader.

    Convenient abstraction to read from a stream (AsyncStream) of Readers as if it were a single Reader.

    readers

    An AsyncStream holds a stream of Reader[A]

  8. def copy[A](r: Reader[A], w: Writer[A]): Future[Unit]

    Copy elements from a Reader to a Writer.

    Copy elements from a Reader to a Writer. The Reader will be discarded if copy is cancelled (discarding the writer). The Writer is unmanaged, the caller is responsible for finalization and error handling, e.g.:

    Reader.copy(r, w, n) ensure w.close()
  9. def copyMany[A](readers: AsyncStream[Reader[A]], target: Writer[A]): Future[Unit]

    Copy elements from many Readers to a Writer.

    Copy elements from many Readers to a Writer. Readers will be discarded if copy is cancelled (discarding the target). The Writer is unmanaged, the caller is responsible for finalization and error handling, e.g.:

    Reader.copyMany(readers, writer) ensure writer.close()
    readers

    An AsyncStream holds a stream of Reader[A]

  10. def empty[A]: Reader[A]
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. def exception[A](e: Throwable): Reader[A]

    Construct a Reader from an exception e

  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def flatten[A](readers: Reader[Reader[A]]): Reader[A]

    Convenient abstraction to read from a stream (Reader) of Readers as if it were a single Reader.

    Convenient abstraction to read from a stream (Reader) of Readers as if it were a single Reader. The subsequent readers are unmanaged, the caller is responsible for discarding those when abandoned.

    readers

    A Reader holds a stream of Reader[A]

  16. def framed(r: Reader[Buf], framer: (Buf) ⇒ Seq[Buf]): Reader[Buf]

    Wraps a Reader[Buf] and emits frames as decided by framer.

    Wraps a Reader[Buf] and emits frames as decided by framer.

    Note

    The returned Reader may not be thread safe depending on the behavior of the framer.

  17. def fromAsyncStream[A](as: AsyncStream[A]): Reader[A]

    Allow AsyncStream to be consumed as a Reader

  18. def fromBuf(buf: Buf, chunkSize: Int): Reader[Buf]

    Create a new Reader from a given Buf.

    Create a new Reader from a given Buf. The output of a returned reader is chunked by at most chunkSize (bytes).

    Note

    The n (number of bytes to read) argument on the returned reader's read is ignored.

  19. def fromBuf(buf: Buf): Reader[Buf]

    Create a new Reader from a given Buf.

    Create a new Reader from a given Buf. The output of a returned reader is chunked by a least chunkSize (bytes).

  20. def fromFile(f: File, chunkSize: Int): Reader[Buf]

    Create a new Reader from a given File.

    Create a new Reader from a given File. The output of a returned reader is chunked by at most chunkSize (bytes).

    The resources held by the returned Reader are released on reading of EOF and Reader.discard().

    See also

    Readers.fromFile for a Java API

  21. def fromFile(f: File): Reader[Buf]

    Create a new Reader from a given File.

    Create a new Reader from a given File. The output of a returned reader is chunked by at most chunkSize (bytes).

    The resources held by the returned Reader are released on reading of EOF and Reader.discard().

    See also

    Readers.fromFile for a Java API

  22. def fromFuture[A](fa: Future[A]): Reader[A]

    Construct a Reader from a Future

    Construct a Reader from a Future

    We want to ensure that this reader always satisfies these invariants: 1. Satisfied closep is always aligned with the state 2. Reading from a discarded reader will always return ReaderDiscardedException 3. Reading from a fully read reader will always return None 4. Reading from an exceptioned reader will always return the exception it has thrown

    We achieved this with a state machine where any access to the state is synchronized, and by ensuring that we always verify the update of state succeeded before setting closep, and by preventing changing the state when the reader is exceptioned, fully read, or discarded

    Note

    Multiple outstanding reads are not allowed on this reader

  23. def fromSeq[A](seq: Seq[A]): Reader[A]

    Create a new Reader from a given Seq.

    Create a new Reader from a given Seq.

    The resources held by the returned Reader are released on reading of EOF and Reader.discard().

  24. def fromStream(s: InputStream, chunkSize: Int): Reader[Buf]

    Create a new Reader from a given InputStream.

    Create a new Reader from a given InputStream. The output of a returned reader is chunked by at most chunkSize (bytes).

    The resources held by the returned Reader are released on reading of EOF and Reader.discard().

    See also

    Readers.fromStream for a Java API

  25. def fromStream(s: InputStream): Reader[Buf]

    Create a new Reader from a given InputStream.

    Create a new Reader from a given InputStream. The output of a returned reader is chunked by at most chunkSize (bytes).

    The resources held by the returned Reader are released on reading of EOF and Reader.discard().

  26. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  32. def readAll(r: Reader[Buf]): Future[Buf]

    Read the entire bytestream presented by r.

  33. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  34. def toAsyncStream[A](r: Reader[A]): AsyncStream[A]

    Transformation (or lift) from Reader into AsyncStream.

  35. def toString(): String
    Definition Classes
    AnyRef → Any
  36. def value[A](a: A): Reader[A]

    Construct a Reader from a value a

    Construct a Reader from a value a

    Note

    Multiple outstanding reads are not allowed on this reader

  37. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped