On Mon, May 17, 2010 at 13:33, Xueming Shen <xueming.s...@oracle.com> wrote: > Martin, > > It appears we should make the defensive copy in this case, as we usually do > in lib code.
Yeah, that does look necessary. Approved! You could also keep the header code inside the method thus: 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) 0, // Modification time MTIME (int) 0, // Modification time MTIME (int) 0, // Modification time MTIME (int) 0, // Extra flags (XFLG) 0 // Operating system (OS) }); } > http://cr.openjdk.java.net/~sherman/4853493/webrev > > -Sherman >