InflaterInputStream.java (read): Loop if data has been read but none output by inflater.
* java/util/zip/InflaterInputStream.java (read): Loop if data has been read but none output by inflater. * java/util/zip/natDeflater.cc (reset): Set is_finished. * java/util/zip/natInflater.cc (reset): Set dist_needed and is_finished. * java/util/zip/ZipOutputStream.java: Replaced with Classpath version. * java/util/zip/ZipFile.java: Replaced with Classpath version. * java/util/zip/ZipEntry.java: Replaced with Classpath version. * java/util/zip/ZipInputStream.java: Replaced with Classpath version. * java/util/zip/ZipConstants.java: Replaced with Classpath version. From-SVN: r54653
This commit is contained in:
parent
21505616a5
commit
5f51b048fb
9 changed files with 1415 additions and 855 deletions
|
@ -1,5 +1,5 @@
|
|||
/* InflaterInputStream.java - Input stream filter for decompressing
|
||||
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -92,23 +92,30 @@ public class InflaterInputStream extends FilterInputStream
|
|||
throw new IOException ("stream closed");
|
||||
if (inf.finished())
|
||||
return -1;
|
||||
if (inf.needsInput())
|
||||
fill ();
|
||||
int count;
|
||||
try
|
||||
|
||||
int count = 0;
|
||||
while (count == 0)
|
||||
{
|
||||
count = inf.inflate(buf, off, len);
|
||||
if (count == 0)
|
||||
if (inf.needsInput())
|
||||
fill ();
|
||||
try
|
||||
{
|
||||
if (this.len == -1)
|
||||
return -1; // Couldn't get any more data to feed to the Inflater
|
||||
if (inf.needsDictionary())
|
||||
throw new ZipException ("Inflater needs Dictionary");
|
||||
}
|
||||
}
|
||||
catch (DataFormatException dfe)
|
||||
{
|
||||
throw new ZipException (dfe.getMessage());
|
||||
count = inf.inflate(buf, off, len);
|
||||
if (count == 0)
|
||||
{
|
||||
if (this.len == -1)
|
||||
{
|
||||
// Couldn't get any more data to feed to the Inflater
|
||||
return -1;
|
||||
}
|
||||
if (inf.needsDictionary())
|
||||
throw new ZipException ("Inflater needs Dictionary");
|
||||
}
|
||||
}
|
||||
catch (DataFormatException dfe)
|
||||
{
|
||||
throw new ZipException (dfe.getMessage());
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue