All Downloads are FREE. Search and download functionalities are using the official Maven repository.

htsjdk.samtools.util.CustomGzipOutputStream Maven / Gradle / Ivy

There is a newer version: 4.3.0
Show newest version
package htsjdk.samtools.util;

import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.GZIPOutputStream;

/**
 * Hacky little class used to allow us to set the compression level on a GZIP output stream which, for some
 * bizarre reason, is not exposed in the standard API.
 *
 * @author Tim Fennell
 */
public class CustomGzipOutputStream extends GZIPOutputStream {
    public CustomGzipOutputStream(final OutputStream outputStream, final int bufferSize, final int compressionLevel) throws
            IOException {
        super(outputStream, bufferSize);
        this.def.setLevel(compressionLevel);
    }

    public CustomGzipOutputStream(final OutputStream outputStream, final int compressionLevel) throws IOException {
        super(outputStream);
        this.def.setLevel(compressionLevel);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy