org.apache.commons.compress.Compressor
public class BZip2Compressor
extends org.apache.commons.compress.AbstractCompressor
Modifier and Type | Field | Description |
---|---|---|
private static java.lang.String |
DEFAULT_FILE_EXTENSION |
|
private static byte[] |
HEADER |
|
private static java.lang.String |
NAME |
Constructor | Description |
---|---|
BZip2Compressor() |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
void |
compressTo(java.io.InputStream in,
java.io.OutputStream out) |
Compresses the input stream and writes the compressed
bytes to the output stream.
|
void |
decompressTo(java.io.InputStream in,
java.io.OutputStream out) |
Decompresses this file and writes the decompressed file to the output-stream
|
java.lang.String |
getDefaultFileExtension() |
Returns a String with the default file extension
for this compressor.
|
byte[] |
getHeader() |
Header byte array for this archive.
|
java.lang.String |
getName() |
Returns the ArchiveName for this archive.
|
private BZip2InputStream |
getPackedInput(java.io.InputStream input) |
Skips the 'BZ' header bytes.
|
private BZip2OutputStream |
getPackedOutput(java.io.OutputStream output) |
Writes a 'BZ' header to the output stream, and creates a
BZip2OutputStream object ready for use, as required by the
BZip2OutputStream class.
|
compress, compress, compressTo, compressToHere, decompress, decompress, decompressTo
private static final byte[] HEADER
private static final java.lang.String NAME
private static java.lang.String DEFAULT_FILE_EXTENSION
public void compressTo(java.io.InputStream in, java.io.OutputStream out) throws org.apache.commons.compress.CompressException
org.apache.commons.compress.Compressor
in
- InputStream to compress toout
- OutputStream to which the byte shall be writtenorg.apache.commons.compress.CompressException
- if the Compressor reports an errorpublic void decompressTo(java.io.InputStream in, java.io.OutputStream out) throws org.apache.commons.compress.CompressException
org.apache.commons.compress.Compressor
in
- Stream to decompressout
- Stream to write the decompressed bytes toorg.apache.commons.compress.CompressException
- if the Compressor reports an errorprivate BZip2InputStream getPackedInput(java.io.InputStream input) throws java.io.IOException
input
- input streamBZip2InputStream
instancejava.io.IOException
- if an IO error occursprivate BZip2OutputStream getPackedOutput(java.io.OutputStream output) throws java.io.IOException
output
- OutputStream
to add a header toBZip2OutputStream
ready to write tojava.io.IOException
- if an IO error occurspublic byte[] getHeader()
org.apache.commons.compress.PackableObject
getHeader
in class org.apache.commons.compress.PackableObject
public java.lang.String getName()
org.apache.commons.compress.PackableObject
getName
in class org.apache.commons.compress.PackableObject
public java.lang.String getDefaultFileExtension()
org.apache.commons.compress.AbstractCompressor
getDefaultFileExtension
in class org.apache.commons.compress.AbstractCompressor