src/share/classes/java/util/zip/GZIPOutputStream.java

Print this page

        

@@ -177,12 +177,12 @@
     }
 
     /*
      * Writes GZIP member header.
      */
-
-    private final static byte[] header = {
+    private void writeHeader() throws IOException {
+        out.write(new byte[] {
         (byte) GZIP_MAGIC,                // Magic number (short)
         (byte)(GZIP_MAGIC >> 8),          // Magic number (short)
         Deflater.DEFLATED,                // Compression method (CM)
         0,                                // Flags (FLG)
         0,                                // Modification time MTIME (int)

@@ -189,14 +189,11 @@
         0,                                // Modification time MTIME (int)
         0,                                // Modification time MTIME (int)
         0,                                // Modification time MTIME (int)
         0,                                // Extra flags (XFLG)
         0                                 // Operating system (OS)
-    };
-
-    private void writeHeader() throws IOException {
-        out.write(header);
+                  });
     }
 
     /*
      * Writes GZIP member trailer to a byte array, starting at a given
      * offset.