Object

scalaz.stream

io

Related Doc: package stream

Permalink

object io

Module of Process functions and combinators for file and network I/O.

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

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def bufferedChannel[R, I, O](acquire: Task[R])(flush: (R) ⇒ Task[O])(release: (R) ⇒ Task[Unit])(step: (R) ⇒ Task[(I) ⇒ Task[O]]): Channel[Task, Option[I], O]

    Permalink

    Implementation of resource for channels where resource needs to be flushed at the end of processing.

  6. def bufferedResource[F[_], R, O](acquire: F[R])(flushAndRelease: (R) ⇒ F[O])(step: (R) ⇒ F[O]): Process[F, O]

    Permalink

    Like resource, but the release action may emit a final value, useful for flushing any internal buffers.

    Like resource, but the release action may emit a final value, useful for flushing any internal buffers. NB: In the event of an error, this final value is ignored.

  7. def chunkR(is: ⇒ InputStream): Channel[Task, Int, ByteVector]

    Permalink

    Creates a Channel[Task,Int,ByteVector] from an InputStream by repeatedly requesting the given number of bytes.

    Creates a Channel[Task,Int,ByteVector] from an InputStream by repeatedly requesting the given number of bytes. The last chunk may be less than the requested size.

    This implementation requires an array allocation for each read. To recycle the input buffer, use unsafeChunkR.

    This implementation closes the InputStream when finished or in the event of an error.

  8. def chunkW(os: ⇒ OutputStream): Sink[Task, ByteVector]

    Permalink

    Creates a Sink from an OutputStream, which will be closed when this Process is halted.

  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. def fileChunkR(f: String, bufferSize: Int = 4096): Channel[Task, Int, ByteVector]

    Permalink

    Creates a Channel from a file name and optional buffer size in bytes.

  13. def fileChunkW(f: String, bufferSize: Int = 4096, append: Boolean = false): Sink[Task, ByteVector]

    Permalink

    Creates a Sink from a file name and optional buffer size in bytes.

    Creates a Sink from a file name and optional buffer size in bytes.

    append

    if true, then bytes will be written to the end of the file rather than the beginning

  14. def fillBuffer[A](buf: Buffer[A]): Sink[Task, A]

    Permalink

    A Sink which, as a side effect, adds elements to the given Buffer.

  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. def iterator[O](i: Task[Iterator[O]]): Process[Task, O]

    Permalink

    Create a Process from an iterator.

    Create a Process from an iterator. The value behind the iterator should be immutable and not rely on an external resource. If that is not the case, use io.iteratorR.

  20. def iteratorR[R, O](req: Task[R])(release: (R) ⇒ Task[Unit])(mkIterator: (R) ⇒ Task[Iterator[O]]): Process[Task, O]

    Permalink

    Create a Process from an iterator that is tied to some resource, R (like a file handle) that we want to ensure is released.

    Create a Process from an iterator that is tied to some resource, R (like a file handle) that we want to ensure is released. See linesR for an example use.

    R

    is the resource

    O

    is a value in the iterator

    req

    acquires the resource

    release

    releases the resource

    mkIterator

    creates the iterator from the resource

  21. def linesR(src: ⇒ scala.io.Source): Process[Task, String]

    Permalink

    Creates a Process[Task,String] from the lines of the Source, using the iteratorR combinator to ensure the Source is closed when processing the stream of lines is finished.

  22. def linesR(in: ⇒ InputStream)(implicit codec: Codec): Process[Task, String]

    Permalink

    Creates a Process[Task,String] from the lines of the InputStream, using the iteratorR combinator to ensure the InputStream is closed when processing the stream of lines is finished.

  23. def linesR(filename: String)(implicit codec: Codec): Process[Task, String]

    Permalink

    Creates a Process[Task,String] from the lines of a file, using the iteratorR combinator to ensure the file is closed when processing the stream of lines is finished.

  24. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. def print(out: PrintStream): Sink[Task, String]

    Permalink

    Turn a PrintStream into a Sink.

    Turn a PrintStream into a Sink. This Sink does not emit newlines after each element. For that, use printLines.

  28. def printLines(out: PrintStream): Sink[Task, String]

    Permalink

    Turn a PrintStream into a Sink.

    Turn a PrintStream into a Sink. This Sink emits newlines after each element. If this is not desired, use print.

  29. def printStreamSink[O](out: PrintStream)(f: (PrintStream, O) ⇒ Unit): Sink[Task, O]

    Permalink

    Creates Sink from an PrintStream using f to perform specific side effects on that PrintStream.

  30. def resource[F[_], R, O](acquire: F[R])(release: (R) ⇒ F[Unit])(step: (R) ⇒ F[O]): Process[F, O]

    Permalink

    Generic combinator for producing a Process[F,O] from some effectful O source.

    Generic combinator for producing a Process[F,O] from some effectful O source. The source is tied to some resource, R (like a file handle) that we want to ensure is released. See chunkW for an example use.

  31. def stdInBytes: Channel[Task, Int, ByteVector]

    Permalink

    The standard input stream, as Process.

    The standard input stream, as Process. This Process repeatedly awaits and emits chunks of bytes from standard input.

  32. def stdInLines: Process[Task, String]

    Permalink

    The standard input stream, as Process.

    The standard input stream, as Process. This Process repeatedly awaits and emits lines from standard input.

  33. def stdOut: Sink[Task, String]

    Permalink

    The standard output stream, as a Sink.

    The standard output stream, as a Sink. This Sink does not emit newlines after each element. For that, use stdOutLines.

  34. def stdOutBytes: Sink[Task, ByteVector]

    Permalink

    The standard output stream, as a ByteVector Sink.

  35. def stdOutLines: Sink[Task, String]

    Permalink

    The standard output stream, as a Sink.

    The standard output stream, as a Sink. This Sink emits newlines after each element. If this is not desired, use stdOut.

  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  37. def toInputStream(p: Process[Task, ByteVector]): InputStream

    Permalink

    Converts a source to a mutable InputStream.

    Converts a source to a mutable InputStream. The resulting input stream should be reasonably efficient and supports early termination (i.e. all finalizers associated with the input process will be run if the stream is closed).

  38. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  39. def unsafeChunkR(is: ⇒ InputStream): Channel[Task, Array[Byte], Array[Byte]]

    Permalink

    Creates a Channel[Task,Array[Byte],Array[Byte]] from an InputStream by repeatedly filling the input buffer.

    Creates a Channel[Task,Array[Byte],Array[Byte]] from an InputStream by repeatedly filling the input buffer. is.read will be called multiple times as needed; however, the last chunk may be less than the requested size.

    It is safe to recycle the same buffer for consecutive reads as long as whatever consumes this Process never stores the Array[Byte] returned or pipes it to a combinator (like buffer) that does. Use chunkR for a safe version of this combinator - this takes an Int number of bytes to read and allocates a fresh Array[Byte] for each read.

    This implementation closes the InputStream when finished or in the event of an error.

  40. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped