Public CustomGzipOutputStream #746

Merged
merged 1 commit into from Nov 22, 2016
Jump to file or symbol
Failed to load files and symbols.
+24 −19
Split
@@ -0,0 +1,24 @@
+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 {
+ CustomGzipOutputStream(final OutputStream outputStream, final int bufferSize, final int compressionLevel) throws
+ IOException {
+ super(outputStream, bufferSize);
+ this.def.setLevel(compressionLevel);
+ }
+
+ CustomGzipOutputStream(final OutputStream outputStream, final int compressionLevel) throws IOException {
+ super(outputStream);
+ this.def.setLevel(compressionLevel);
+ }
+}
@@ -944,22 +944,3 @@ public static String slurp(final InputStream is, final Charset charSet) {
return output;
}
}
-
-
-/**
- * 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
- */
-class CustomGzipOutputStream extends GZIPOutputStream {
- CustomGzipOutputStream(final OutputStream outputStream, final int bufferSize, final int compressionLevel) throws IOException {
- super(outputStream, bufferSize);
- this.def.setLevel(compressionLevel);
- }
-
- CustomGzipOutputStream(final OutputStream outputStream, final int compressionLevel) throws IOException {
- super(outputStream);
- this.def.setLevel(compressionLevel);
- }
-}