|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unikassel.android.sdcframework.util.ZipCompressionStrategy
public class ZipCompressionStrategy
The compression strategy to create ZIP archives.
Field Summary | |
---|---|
private byte[] |
buffer
the internal buffer |
private static int |
BUFFER_SIZE
The internal buffer size used while piping data |
private int |
level
The compression level |
private int |
method
The compression method |
Constructor Summary | |
---|---|
|
ZipCompressionStrategy()
Constructor |
|
ZipCompressionStrategy(boolean deflated)
Constructor |
protected |
ZipCompressionStrategy(int method,
int level)
Constructor |
Method Summary | |
---|---|
boolean |
compress(List<String> files,
BufferedOutputStream out)
The compression method |
protected ZipEntry |
createArchiveEntry(String file)
Does create an archive entry for the compressed file |
protected ZipOutputStream |
createDeflaterOutPutStream(BufferedOutputStream out)
Does create the deflater output stream |
String |
getArchiveExtension()
Getter for an archive file extension of this strategy |
int |
getMethod()
Getter for the method |
private void |
pipeInToOut(BufferedInputStream in,
DeflaterOutputStream out)
Method to pipe input into output stream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int BUFFER_SIZE
private final byte[] buffer
private final int method
private final int level
Constructor Detail |
---|
public ZipCompressionStrategy()
protected ZipCompressionStrategy(int method, int level)
public ZipCompressionStrategy(boolean deflated)
deflated
- flag for archive content compression ( true for compression )Method Detail |
---|
public final int getMethod()
public boolean compress(List<String> files, BufferedOutputStream out) throws IOException
CompressionStrategy
compress
in interface CompressionStrategy
files
- a list with the files to compressout
- the output stream to compress files into
IOException
- if closing the output stream failsprotected ZipEntry createArchiveEntry(String file)
file
- the file name and path
protected ZipOutputStream createDeflaterOutPutStream(BufferedOutputStream out) throws IOException
out
- the buffered output stream to wrap
IOException
private void pipeInToOut(BufferedInputStream in, DeflaterOutputStream out) throws IOException
in
- the input streamout
- the deflater output stream
IOException
- in case of an IO exceptionpublic String getArchiveExtension()
CompressionStrategy
getArchiveExtension
in interface CompressionStrategy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |