Object

org.gerweck.scala.util.stream

ZipStream

Related Doc: package stream

Permalink

object ZipStream

Provider of streams that take in zip entries and produces zipped data as output.

This offers a number of methods that will create Akka Streams stages that can be used to write zip archives. To write to your zip, you will send in a stream of ZipStream.Entry objects, which are an abstraction of a single entry in a zip archive.

The structure of a zip archive requires that a single entry is written to completion once it is started, so you may wish to organize the incoming stream so that it does not emit an Entry until its data is available.

For example, if the contents of a file are generated by a database query, you may wish to have the completion of the query produce the Entry object rather than immediately producing an entry that then executes a query to fetch the required data.

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

Type Members

  1. final class Entry extends AnyRef

    Permalink

    An entry to be written into the zip file.

    An entry to be written into the zip file.

    Note

    These are NOT serializable, as they contain a stream Source.

  2. sealed trait ExistingFile extends AnyRef

    Permalink

    Describes what to do if a target path already exists

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

    Permalink

    Contains options for handling existing files.

  5. def asFlow(buffer: Option[Int] = defaultFlowBuffer)(implicit ec: ExecutionContext): Flow[Entry, ByteString, Future[IOResult]]

    Permalink

    A zip compressor that takes in entries and flows out bytes.

    A zip compressor that takes in entries and flows out bytes.

    buffer

    the size (in bytes) of an optional buffer that will hold the zipped data before it is converted into ByteString objects. Using a buffer can substantially improve performance, as otherwise you may have many stream elements with just a few bytes in them.

    ec

    the execution context to use for any callback operations. This context will not be used for any long-running or blocking operations.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. val defaultFileBuffer: Option[Int]

    Permalink

    The default buffer size when writing zipped data to a file.

  9. val defaultFlowBuffer: Option[Int]

    Permalink

    The default buffer size when outputting zipped data as a stream.

  10. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

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

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

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

    Permalink
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toFile(path: Path, existingFile: ExistingFile = ExistingFile.Fail, buffer: Option[Int] = defaultFileBuffer)(implicit ec: ExecutionContext): Sink[Entry, Future[IOResult]]

    Permalink

    A zip compressor that takes in entries and writes them to a file.

    A zip compressor that takes in entries and writes them to a file.

    path

    the location of the file to be written.

    existingFile

    what to do if there is already a file at the provided path.

    buffer

    the size (in bytes) of an optional buffer that will hold the zipped data before it is written to the file. The OS probably offers output buffering, but this can potentially reduce the number of OS-level writes that need to be made.

    ec

    the execution context to use for any callback operations. This context will not be used for any long-running or blocking operations.

  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped