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 newBGZIPOutputStream
instance that writes to the specified output stream. -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
BGZIPOutputStream
Creates a newBGZIPOutputStream
instance that writes to the specified output stream.- Parameters:
os
- the output streamwriteEmptyBlock
-true
if 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 anIOException
is 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:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-