Class GzUtils
java.lang.Object
com.compomics.util.io.compression.GzUtils
public class GzUtils extends Object
Convenience methods to work with gzipped files. Note: IOExceptions are thrown
by each method as RuntimeException.
- Author:
- Marc Vaudel
-
Field Summary
Fields Modifier and Type Field Description static int
BUFFER_LENGTH
The length of the character buffer to use.static String
GZ_EXTENSION
The extension to use for gz files. -
Constructor Summary
Constructors Constructor Description GzUtils()
-
Method Summary
Modifier and Type Method Description static void
gunzipFile(File gzFile, boolean remove)
Uncompresses the given gz file to the given destination file.static void
gunzipFile(File gzFile, File destinationFile, boolean remove)
Uncompresses the given gz file to the given destination file.static void
gzFile(File file, boolean remove)
Gzip a file.If the gz file already exists it will be silently overwritten.static void
gzFile(File file, File gzFile, boolean remove)
Gzip a file.If the gz file already exists it will be silently overwritten.
-
Field Details
-
BUFFER_LENGTH
public static final int BUFFER_LENGTHThe length of the character buffer to use.- See Also:
- Constant Field Values
-
GZ_EXTENSION
The extension to use for gz files.- See Also:
- Constant Field Values
-
-
Constructor Details
-
GzUtils
public GzUtils()
-
-
Method Details
-
gzFile
Gzip a file.If the gz file already exists it will be silently overwritten.- Parameters:
file
- the file to readremove
- if true the original file will be removed
-
gzFile
Gzip a file.If the gz file already exists it will be silently overwritten.- Parameters:
file
- the file to readgzFile
- the gz file to writeremove
- if true the original file will be removed
-
gunzipFile
Uncompresses the given gz file to the given destination file. If the destination file already exists it will be silently overwritten.- Parameters:
gzFile
- the gz file to readremove
- if true the gz file will be deleted upon completion
-
gunzipFile
Uncompresses the given gz file to the given destination file. If the destination file already exists it will be silently overwritten.- Parameters:
gzFile
- the gz file to readdestinationFile
- the file to writeremove
- if true the gz file will be deleted upon completion
-