Package blbutil
Class BGZIPOutputStream
java.lang.Object
java.io.OutputStream
blbutil.BGZIPOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Class BGZIPOutputStream is an output stream filter that performs
BGZIP compression.
The GZIP file format specification is described RFC 1952 and the BGZIP file format specification is described in the Sequence Alignment/Map Format Specification
Instances of class BGZIPOutputStream are not thread safe.
-
Constructor Summary
ConstructorsConstructorDescriptionBGZIPOutputStream(OutputStream os, boolean writeEmptyBlock) Creates a newBGZIPOutputStreaminstance that writes to the specified output stream. -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
BGZIPOutputStream
Creates a newBGZIPOutputStreaminstance that writes to the specified output stream.- Parameters:
os- the output streamwriteEmptyBlock-trueif theclose()method will write an empty BGZIP block to the end of the stream- Throws:
NullPointerException- ifos == null
-
-
Method Details
-
main
Applies BGZIP compression on the specified files. The filename of each compressed file will be the original filename followed by ".gz". The original files are not deleted or overwritten. The program exits with an error message if any input filename ends with ".gz".- Parameters:
args- a list of files that will be compressed- Throws:
IOException- if an I/O error occurs
-
writeEmptyBlock
Write an empty BGZIP block to the specified output stream. The Java Virtual Machine will exit with an error message if anIOExceptionis thrown while writing the empty BGZIP block.- Parameters:
os- the output stream- Throws:
IOException- if an I/O error occursNullPointerException- ifos == null
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-