public class BGZFEnhancedGzipCodec
extends org.apache.hadoop.io.compress.GzipCodec
implements org.apache.hadoop.io.compress.SplittableCompressionCodec
CompressionCodec for the
BGZF compression format,
which reads and writes files with a .gz suffix.
BGZF is a splittable extension of gzip, which means that all BGZF files are standard
gzip files, however the reverse is not necessarily the case. BGZF files often have the
standard .gz suffix (such as those produced by the
bcftools command),
which causes a difficulty since it is not immediately apparent from the filename alone
whether a file is a BGZF file, or merely a regular gzip file. BGZFEnhancedGzipCodec
will read the start of the file to look for BGZF headers to detect the type of
compression.
BGZFEnhancedGzipCodec will read BGZF or gzip files, but currently always writes regular gzip files.
To use BGZFEnhancedGzipCodec, set it on the configuration object as follows. This will
override the built-in GzipCodec that is mapped to the .gz suffix.
conf.set("io.compression.codecs", BGZFEnhancedGzipCodec.class.getCanonicalName())
BGZFCodec| Constructor and Description |
|---|
BGZFEnhancedGzipCodec() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.hadoop.io.compress.SplitCompressionInputStream |
createInputStream(InputStream seekableIn,
org.apache.hadoop.io.compress.Decompressor decompressor,
long start,
long end,
org.apache.hadoop.io.compress.SplittableCompressionCodec.READ_MODE readMode) |
createCompressor, createDecompressor, createInputStream, createInputStream, createOutputStream, createOutputStream, getCompressorType, getDecompressorType, getDefaultExtensionpublic org.apache.hadoop.io.compress.SplitCompressionInputStream createInputStream(InputStream seekableIn, org.apache.hadoop.io.compress.Decompressor decompressor, long start, long end, org.apache.hadoop.io.compress.SplittableCompressionCodec.READ_MODE readMode) throws IOException
createInputStream in interface org.apache.hadoop.io.compress.SplittableCompressionCodecIOExceptionCopyright © 2016. All rights reserved.