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
Content Hierarchy
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 Zippable

    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. case class EntryMetadata(name: String, creation: Option[Instant] = None, lastAccess: Option[Instant] = None, lastModified: Option[Instant] = None, comment: Option[String] = None, extra: Option[Array[Byte]] = None) extends Product with Serializable

    Permalink

    The metadata associated with a single entry in a zip file.

  3. sealed trait EntryStorage extends AnyRef

    Permalink
  4. final class ExistingZip extends Zippable

    Permalink
  5. sealed trait Zippable extends AnyRef

    Permalink

    A source of data that can be included in a stream that is constructing zipped data.

    A source of data that can be included in a stream that is constructing zipped data. These provide a stream and thus they are not serializable.

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 DeflateEntry extends EntryStorage with Product with Serializable

    Permalink
  5. object EntryMetadata extends Serializable

    Permalink
  6. object EntryStorage

    Permalink
  7. object ExistingZip

    Permalink
  8. object StoreEntry extends EntryStorage with Product with Serializable

    Permalink
  9. final def asInstanceOf[T0]: T0

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

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

    Permalink

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

  12. val defaultFlowBuffer: Option[Int]

    Permalink

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  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. final def ne(arg0: AnyRef): Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef
  23. def toFile(path: Path, existingFile: ExistingFile = ExistingFile.Fail, buffer: Option[Int] = defaultFileBuffer, level: Option[Int] = None)(implicit ec: ExecutionContext): Sink[Zippable, 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.

    level

    the compression level to use when generating the zip. Use None to get the default compression, which is generally a good compromise.

    ec

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

  24. def toStream(buffer: Option[Int] = defaultFlowBuffer, level: Option[Int] = None)(implicit ec: ExecutionContext): Flow[Zippable, 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.

    level

    the compression level to use when generating the zip. Use None to get the default compression, which is generally a good compromise.

    ec

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

  25. def toString(): String

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped