harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r537883 - /harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/GZIPInputStream.java
Date Mon, 14 May 2007 15:37:30 GMT
Author: ayza
Date: Mon May 14 08:37:29 2007
New Revision: 537883

URL: http://svn.apache.org/viewvc?view=rev&rev=537883
Log:
Applying slightly truncated version of the patch from HARMONY-3703 ( [classlib][archive][netbeans]
GZIPInputStream throws IOException when feeding from the network)

Modified:
    harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/GZIPInputStream.java

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/GZIPInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/GZIPInputStream.java?view=diff&rev=537883&r1=537882&r2=537883
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/GZIPInputStream.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/GZIPInputStream.java
Mon May 14 08:37:29 2007
@@ -148,20 +148,15 @@
             } else if (!eos) {
 				eos = true;
 				// Get non-compressed bytes read by fill
-				int size = 0;
+				int size = inf.getRemaining();
 				byte[] b = new byte[8];
-				int inB = inf.getTotalIn();
-				if (inB > 0) {
-					int diff = inB % buf.length;
-					if (diff != 0 || len != buf.length) {
-						size = len - diff;
-						if (size > b.length) {
-                            size = b.length;
-                        }
-						System.arraycopy(buf, diff, b, 0, size);
-					}
+
+				if (size > b.length) {
+					size = b.length;
 				}
+				System.arraycopy(buf, len - size, b, 0, size);
 				readFully(b, size, b.length - size);
+
 				if (getLong(b, 0) != crc.getValue()) {
                     throw new IOException(Messages.getString("archive.20")); //$NON-NLS-1$
                 }



Mime
View raw message