scalaz.stream

io

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
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. 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]

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

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

    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.

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

    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.

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

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

  11. def clone(): AnyRef

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

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

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

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

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

    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

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

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

  17. def finalize(): Unit

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

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

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

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

    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.

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

    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

    returns

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

    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.

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

    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.

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

    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.

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

    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

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

    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.

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

    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.

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

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

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

    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.

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

    The standard input stream, as Process.

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

  34. def stdInLines: Process[Task, String]

    The standard input stream, as Process.

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

  35. def stdOut: Sink[Task, String]

    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.

  36. def stdOutBytes: Sink[Task, ByteVector]

    The standard output stream, as a ByteVector Sink.

  37. def stdOutLines: Sink[Task, String]

    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.

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

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

    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).

  40. def toString(): String

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

    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. 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.

  42. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped