classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] [generics] Patch: FYI: java.util.zip updates


From: Tom Tromey
Subject: [cp-patches] [generics] Patch: FYI: java.util.zip updates
Date: 20 Apr 2005 14:30:39 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

I'm checking this in on the generics branch.

java.util.zip got some new methods in 1.5.

Tom

2005-04-19  Tom Tromey  <address@hidden>

        * java/util/zip/Inflater.java (getTotalIn): Deprecated.
        (getBytesRead): New method
        (getTotalOut): Deprecated.
        (getBytesWritten): New method.
        (totalIn, totalOut): Now 'long'.
        * java/util/zip/DeflaterEngine.java (totalIn): Now 'long'.
        (getTotalIn): Return 'long'.
        * java/util/zip/Deflater.java (totalOut): Now 'long'.
        (getTotalOut): Deprecated.
        (getBytesWritten): New method.
        (getTotalIn): Deprecated.
        (getBytesRead): New method.

Index: java/util/zip/Deflater.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/zip/Deflater.java,v
retrieving revision 1.5
diff -u -r1.5 Deflater.java
--- java/util/zip/Deflater.java 29 Apr 2004 15:47:26 -0000 1.5
+++ java/util/zip/Deflater.java 20 Apr 2005 20:15:32 -0000
@@ -1,5 +1,5 @@
 /* Deflater.java - Compress a data stream
-   Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -150,7 +150,7 @@
   private int state;
 
   /** The total bytes of output written. */
-  private int totalOut;
+  private long totalOut;
  
   /** The pending output. */
   private DeflaterPending pending;
@@ -242,16 +242,36 @@
   /** 
    * Gets the number of input bytes processed so far.
    */
+  @Deprecated
   public int getTotalIn()
   {
+    return (int) engine.getTotalIn();
+  }
+
+  /** 
+   * Gets the number of input bytes processed so far.
+   * @since 1.5
+   */
+  public long getBytesRead()
+  {
     return engine.getTotalIn();
   }
 
   /** 
    * Gets the number of output bytes so far.
    */
+  @Deprecated
   public int getTotalOut()
   {
+    return (int) totalOut;
+  }
+
+  /** 
+   * Gets the number of output bytes so far.
+   * @since 1.5
+   */
+  public long getBytesWritten()
+  {
     return totalOut;
   }
 
Index: java/util/zip/DeflaterEngine.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/zip/DeflaterEngine.java,v
retrieving revision 1.6.2.1
diff -u -r1.6.2.1 DeflaterEngine.java
--- java/util/zip/DeflaterEngine.java 15 Jan 2005 17:02:16 -0000 1.6.2.1
+++ java/util/zip/DeflaterEngine.java 20 Apr 2005 20:15:32 -0000
@@ -1,5 +1,5 @@
 /* DeflaterEngine.java --
-   Copyright (C) 2001, 2004  Free Software Foundation, Inc.
+   Copyright (C) 2001, 2004, 2005  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -92,7 +92,7 @@
   private byte[] inputBuf;
 
   /** The total bytes of input read. */
-  private int totalIn;
+  private long totalIn;
 
   /** The offset into inputBuf, where input data starts. */
   private int inputOff;
@@ -163,7 +163,7 @@
     return chksum;
   }
 
-  public final int getTotalIn()
+  public final long getTotalIn()
   {
     return totalIn;
   }
Index: java/util/zip/Inflater.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/zip/Inflater.java,v
retrieving revision 1.6
diff -u -r1.6 Inflater.java
--- java/util/zip/Inflater.java 22 May 2003 07:22:39 -0000 1.6
+++ java/util/zip/Inflater.java 20 Apr 2005 20:15:32 -0000
@@ -1,5 +1,5 @@
 /* Inflater.java - Decompress a data stream
-   Copyright (C) 1999, 2000, 2001, 2003  Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2003, 2005  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -140,13 +140,13 @@
   /**
    * The total number of inflated bytes.
    */
-  private int totalOut;
+  private long totalOut;
   /**
    * The total number of bytes set with setInput().  This is not the
    * value returned by getTotalIn(), since this also includes the 
    * unprocessed input.
    */
-  private int totalIn;
+  private long totalIn;
   /**
    * This variable stores the nowrap flag that was given to the constructor.
    * True means, that the inflated stream doesn't contain a header nor the
@@ -247,8 +247,19 @@
    * Gets the total number of processed compressed input bytes.
    * @return the total number of bytes of processed input bytes.
    */
+  @Deprecated
   public int getTotalIn()
   {
+    return (int) (totalIn - getRemaining());
+  }
+
+  /**
+   * Gets the total number of processed compressed input bytes.
+   * @return the total number of bytes of processed input bytes.
+   * @since 1.5
+   */
+  public long getBytesRead()
+  {
     return totalIn - getRemaining();
   }
 
@@ -256,8 +267,19 @@
    * Gets the total number of output bytes returned by inflate().
    * @return the total number of output bytes.
    */
+  @Deprecated
   public int getTotalOut()
   {
+    return (int) totalOut;
+  }
+
+  /**
+   * Gets the total number of output bytes returned by inflate().
+   * @return the total number of output bytes.
+   * @since 1.5
+   */
+  public long getBytesWritten()
+  {
     return totalOut;
   }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]