object Reader
- Alphabetic
- By Inheritance
- Reader
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def concat[A](readers: Seq[Reader[A]]): Reader[A]
Convenient abstraction to read from a collection of Readers as if it were a single Reader.
Convenient abstraction to read from a collection of Readers as if it were a single Reader.
- readers
A collection of Reader[A]
- 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]
- def empty[A]: Reader[A]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exception[A](e: Throwable): Reader[A]
Construct a
Reader
from an exceptione
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- 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.
- readers
A Reader holds a stream of Reader[A]
- Note
All operations of the new Reader will be in sync with the outermost Reader. Discarding one Reader will discard the other Reader. When one Reader's onClose resolves, the other Reader's onClose will be resolved immediately with the same value. The subsequent readers are unmanaged, the caller is responsible for discarding those when abandoned.
- def fromAsyncStream[A](as: AsyncStream[A]): Reader[A]
Allow com.twitter.concurrent.AsyncStream to be consumed as a Reader
- def fromBuf(buf: Buf, chunkSize: Int): Reader[Buf]
- def fromBuf(buf: Buf): Reader[Buf]
- def fromCollection[A](list: Collection[A]): Reader[A]
Java-Friendly version of fromSeq Create a new Reader from a given Java
List
- 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 mostchunkSize
(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
- 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 mostchunkSize
(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
- def fromFuture[A](fa: Future[A]): Reader[A]
Construct a
Reader
from aFuture
Construct a
Reader
from aFuture
- Note
Multiple outstanding reads are not allowed on this reader
- def fromIterator[A](it: Iterator[A]): Reader[A]
Create a new Reader from a given
Iterator
.Create a new Reader from a given
Iterator
.The resources held by the returned Reader are released on reading of EOF and Reader.discard.
- Note
It is not recommended to call
it.next()
after creating aReader
from it. Doing so will affect the behavior ofReader.read()
because it will skip the value returned fromit.next
.
- 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.
- Note
Multiple outstanding reads are not allowed on this reader.
- 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 mostchunkSize
(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
- 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 mostchunkSize
(bytes).The resources held by the returned Reader are released on reading of EOF and Reader.discard.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def readAllItems[A](r: Reader[A]): Future[Seq[A]]
Read all items from the Reader r.
Read all items from the Reader r.
- r
The reader to read from
- returns
A Sequence of items.
- def readAllItemsInterruptible[A](r: Reader[A]): Future[Seq[A]]
Read all items from the Reader r, interrupting the returned future will discard the reader.
Read all items from the Reader r, interrupting the returned future will discard the reader.
- r
The reader to read from
- returns
A Sequence of items.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toAsyncStream[A](r: Reader[A]): AsyncStream[A]
Transformation (or lift) from Reader into
AsyncStream
. - def toString(): String
- Definition Classes
- AnyRef → Any
- def value[A](a: A): Reader[A]
Construct a
Reader
from a valuea
Construct a
Reader
from a valuea
- Note
Multiple outstanding reads are not allowed on this reader
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()