Class GzUtils
java.lang.Object
com.compomics.util.io.compression.GzUtils
Convenience methods to work with gzipped files. Note: IOExceptions are thrown
by each method as RuntimeException.
- Author:
- Marc Vaudel
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe length of the character buffer to use.static final StringThe extension to use for gz files. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidgunzipFile(File gzFile, boolean remove) Uncompresses the given gz file to the given destination file.static voidgunzipFile(File gzFile, File destinationFile, boolean remove) Uncompresses the given gz file to the given destination file.static voidGzip a file.static voidGzip a file.
-
Field Details
-
BUFFER_LENGTH
public static final int BUFFER_LENGTHThe length of the character buffer to use.- See Also:
-
GZ_EXTENSION
The extension to use for gz files.- See Also:
-
-
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
-