>>>>> "Lillian" == Lillian Angel <[EMAIL PROTECTED]> writes:
Lillian> 2006-04-04 Lillian Angel <[EMAIL PROTECTED]>
Lillian> * java/util/zip/ZipFile.java
Lillian> (getInputStream): Fixed to return size of ZipEntry
Lillian> minus the total bytes read. This guarantees that the
Lillian> right value is returned even if some bytes have already
Lillian> been read.
Sorry, I think there is one more potential problem here.
'entry.getSize()' can return -1 if the size is unknown.
In this case this implementation of available() will return the wrong
results.
I'm checking this in.
Tom
2006-04-05 Tom Tromey <[EMAIL PROTECTED]>
* java/util/zip/ZipFile.java (available): Defer to super if
entry's size is unknown.
Index: java/util/zip/ZipFile.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/zip/ZipFile.java,v
retrieving revision 1.32
diff -u -r1.32 ZipFile.java
--- java/util/zip/ZipFile.java 4 Apr 2006 14:05:20 -0000 1.32
+++ java/util/zip/ZipFile.java 5 Apr 2006 20:18:38 -0000
@@ -451,6 +451,8 @@
{
public int available() throws IOException
{
+ if (sz == -1)
+ return super.available();
if (super.available() != 0)
return sz - inf.getTotalOut();
return 0;