/[classpath]/classpath/java/util/zip/GZIPOutputStream.java
ViewVC logotype

Diff of /classpath/java/util/zip/GZIPOutputStream.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by mkoch, Wed May 5 13:04:15 2004 UTC revision 1.9 by mkoch, Fri Jul 16 08:39:02 2004 UTC
# Line 61  public class GZIPOutputStream extends De Line 61  public class GZIPOutputStream extends De
61     */     */
62    protected CRC32 crc;    protected CRC32 crc;
63    
64    /* Creates a GZIPOutputStream with the default buffer size    /**
65     *     * Creates a GZIPOutputStream with the default buffer size
66     *     *
67     * @param out The stream to read data (to be compressed) from     * @param out The stream to read data (to be compressed) from
68     *     *
# Line 81  public class GZIPOutputStream extends De Line 81  public class GZIPOutputStream extends De
81    public GZIPOutputStream(OutputStream out, int size) throws IOException    public GZIPOutputStream(OutputStream out, int size) throws IOException
82    {    {
83      super(out, new Deflater(Deflater.DEFAULT_COMPRESSION, true), size);      super(out, new Deflater(Deflater.DEFAULT_COMPRESSION, true), size);
       
84      crc = new CRC32();      crc = new CRC32();
85      int mod_time = (int) (System.currentTimeMillis() / 1000L);      int mod_time = (int) (System.currentTimeMillis() / 1000L);
86      byte[] gzipHeader =      byte[] gzipHeader =
# Line 110  public class GZIPOutputStream extends De Line 109  public class GZIPOutputStream extends De
109      out.write(gzipHeader);      out.write(gzipHeader);
110      //    System.err.println("wrote GZIP header (" + gzipHeader.length + " bytes )");      //    System.err.println("wrote GZIP header (" + gzipHeader.length + " bytes )");
111    }    }
112      
113    public synchronized void write(byte[] buf, int off, int len)    public synchronized void write(byte[] buf, int off, int len)
114      throws IOException      throws IOException
115    {    {
116      super.write(buf, off, len);      super.write(buf, off, len);
117      crc.update(buf, off, len);      crc.update(buf, off, len);
118    }    }
119      
120    /** Writes remaining compressed output data to the output stream    /**
121       * Writes remaining compressed output data to the output stream
122     * and closes it.     * and closes it.
123     */     */
124    public void close() throws IOException    public void close() throws IOException

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26