public class ScatterZipOutputStream
extends java.lang.Object
implements java.io.Closeable
The internal data format of the entries used by this class are entirely private to this class and are not part of any public api whatsoever.
It is possible to extend this class to support different kinds of backing storage, the default implementation only supports file-based backing.
Thread safety: This class supports multiple threads. But the "writeTo" method must be called by the thread that originally created theZipArchiveEntry
.Constructor and Description |
---|
ScatterZipOutputStream(ScatterGatherBackingStore backingStore,
StreamCompressor streamCompressor) |
Modifier and Type | Method and Description |
---|---|
void |
addArchiveEntry(ZipArchiveEntryRequest zipArchiveEntryRequest)
Add an archive entry to this scatter stream.
|
void |
close()
Closes this stream, freeing all resources involved in the creation of this stream.
|
static ScatterZipOutputStream |
fileBased(java.io.File file)
Create a
ScatterZipOutputStream with default compression level that is backed by a file |
static ScatterZipOutputStream |
fileBased(java.io.File file,
int compressionLevel)
Create a
ScatterZipOutputStream that is backed by a file |
void |
writeTo(ZipArchiveOutputStream target)
Write the contents of this scatter stream to a target archive.
|
public ScatterZipOutputStream(ScatterGatherBackingStore backingStore, StreamCompressor streamCompressor)
public void addArchiveEntry(ZipArchiveEntryRequest zipArchiveEntryRequest) throws java.io.IOException
zipArchiveEntryRequest
- The entry to write.java.io.IOException
- If writing failspublic void writeTo(ZipArchiveOutputStream target) throws java.io.IOException
target
- The archive to receive the contents of this ScatterZipOutputStream
.java.io.IOException
- If writing failspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
- If closing failspublic static ScatterZipOutputStream fileBased(java.io.File file) throws java.io.FileNotFoundException
ScatterZipOutputStream
with default compression level that is backed by a filefile
- The file to offload compressed data into.java.io.FileNotFoundException
- if the file cannot be foundpublic static ScatterZipOutputStream fileBased(java.io.File file, int compressionLevel) throws java.io.FileNotFoundException
ScatterZipOutputStream
that is backed by a filefile
- The file to offload compressed data into.compressionLevel
- The compression level to use, @see #Deflaterjava.io.FileNotFoundException
- if the file cannot be found"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"