|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.util.CompressionUtil
public class CompressionUtil
Helper methods for using various compression encodings. Includes methods that use temporary files and methods that don't.
| Constructor Summary | |
|---|---|
CompressionUtil()
|
|
| Method Summary | |
|---|---|
static java.io.File |
bzip2Compress(java.io.File input)
bzip2 compresses the input zipFile and returns a reference to the compressed zipFile. |
static java.io.File |
bzip2Decompress(java.io.File input)
Decompresses the input zipFile assuming that it is bzip2 compressed. |
static byte[] |
gzipCompress(byte[] dataBytes,
byte[] padding)
GZIPs the in memory and returns the compressed bytes. |
static java.io.File |
gzipCompress(java.io.File input)
GZIPs the input zipFile and returns a pointer to a zipFile that is GZIP compressed. |
static byte[] |
gzipDecompress(byte[] dataBytes)
Decompresses the input bytes assuming that it is GZIP'd. |
static java.io.File |
gzipDecompress(java.io.File input)
Decompresses the input zipFile assuming that it is GZIP'd. |
static java.io.File |
lzmaCompress(java.io.File input)
Compresses the input zipFile using LZMA. |
static byte[] |
lzmaDecompress(byte[] bytes)
Decompresses the input bytes assuming that it is LZMA compressed. |
static java.io.File |
lzmaDecompress(java.io.File input)
Decompresses the input zipFile assuming that it is LZMA compressed. |
static java.io.File |
tarCompress(java.io.File directory)
|
static java.io.File |
tarDecompress(java.io.File file,
java.lang.String directoryName)
|
static java.io.File |
tbzCompress(java.io.File directory)
|
static java.io.File |
tgzCompress(java.io.File directory)
|
static java.io.File |
zipCompress(java.io.File file)
Zip compress/archive a single zipFile or directory. |
static java.io.File |
zipDecompress(java.io.File file,
java.lang.String directoryName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompressionUtil()
| Method Detail |
|---|
public static final java.io.File tgzCompress(java.io.File directory)
throws java.io.IOException
file -
java.io.IOException
public static final java.io.File tbzCompress(java.io.File directory)
throws java.io.IOException
file -
java.io.IOException
public static final java.io.File tarCompress(java.io.File directory)
throws java.io.IOException
file -
java.io.IOException
public static final java.io.File tarDecompress(java.io.File file,
java.lang.String directoryName)
throws java.io.IOException
zipFile - directoryName -
java.io.IOException
public static final java.io.File zipCompress(java.io.File file)
throws java.io.IOException
Zip compress/archive a single zipFile or directory.
file -
java.io.IOException
public static final java.io.File zipDecompress(java.io.File file,
java.lang.String directoryName)
throws java.io.IOException
zipFile -
java.io.IOException
public static final byte[] gzipCompress(byte[] dataBytes,
byte[] padding)
throws java.io.IOException
GZIPs the in memory and returns the compressed bytes. Avoids any time penalties associated with making/using files.
dataBytes - padding -
java.io.IOException
public static final byte[] gzipDecompress(byte[] dataBytes)
throws java.io.IOException
Decompresses the input bytes assuming that it is GZIP'd. Completely avoids the use of temporary files, which saves associated time.
dataBytes -
java.io.IOException
public static final java.io.File gzipCompress(java.io.File input)
throws java.io.IOException
GZIPs the input zipFile and returns a pointer to a zipFile that is GZIP compressed.
input -
java.io.IOException
public static final java.io.File gzipDecompress(java.io.File input)
throws java.io.IOException
Decompresses the input zipFile assuming that it is GZIP'd.
input -
java.io.IOException
public static final java.io.File bzip2Compress(java.io.File input)
throws java.io.IOException
bzip2 compresses the input zipFile and returns a reference to the compressed zipFile.
input -
java.io.IOException
public static final java.io.File bzip2Decompress(java.io.File input)
throws java.io.IOException
Decompresses the input zipFile assuming that it is bzip2 compressed.
input -
java.io.IOException
public static final java.io.File lzmaDecompress(java.io.File input)
throws java.lang.Exception
Decompresses the input zipFile assuming that it is LZMA compressed.
input -
java.lang.Exception
public static final byte[] lzmaDecompress(byte[] bytes)
throws java.lang.Exception
Decompresses the input bytes assuming that it is LZMA compressed.
bytes -
java.lang.Exception
public static final java.io.File lzmaCompress(java.io.File input)
throws java.lang.Exception
Compresses the input zipFile using LZMA.
input -
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||