A
Andrew Tucker
Hi, i am getting:
java.io.EOFException: Unexpected end of ZLIB input stream
while attempting to use java.util.zip.*
I have chased this up w/ groups.google and then w/ the bug parade at Sun.
It seems to be an unresolved issue.
I was wondering if comeone could take a quick look at the following method
and tell me (bugs aside) whether there is anything wrong with this.
private File uncompress(File f) throws Exception {
File toReturn = null;
try {
toReturn = new File("" + f.getName() + ".uncomp");
ZipInputStream zin = new ZipInputStream(new FileInputStream(f));
FileOutputStream out = new FileOutputStream(toReturn);
ZipEntry e;
byte[] buffer = new byte[512];
int len = 0;
while((e = zin.getNextEntry()) != null) {
System.out.println("looping, zip entry: " + e.getName());
while((len=zin.read(buffer)) != -1) {
System.out.println("" + len);
out.write(buffer, 0, len);
}
zin.closeEntry();
}
zin.close();
out.close();
} catch( Exception exc ) {
exc.printStackTrace();
throw new Exception("Exception occurred in method uncompress.");
}
return toReturn;
}
java.io.EOFException: Unexpected end of ZLIB input stream
while attempting to use java.util.zip.*
I have chased this up w/ groups.google and then w/ the bug parade at Sun.
It seems to be an unresolved issue.
I was wondering if comeone could take a quick look at the following method
and tell me (bugs aside) whether there is anything wrong with this.
private File uncompress(File f) throws Exception {
File toReturn = null;
try {
toReturn = new File("" + f.getName() + ".uncomp");
ZipInputStream zin = new ZipInputStream(new FileInputStream(f));
FileOutputStream out = new FileOutputStream(toReturn);
ZipEntry e;
byte[] buffer = new byte[512];
int len = 0;
while((e = zin.getNextEntry()) != null) {
System.out.println("looping, zip entry: " + e.getName());
while((len=zin.read(buffer)) != -1) {
System.out.println("" + len);
out.write(buffer, 0, len);
}
zin.closeEntry();
}
zin.close();
out.close();
} catch( Exception exc ) {
exc.printStackTrace();
throw new Exception("Exception occurred in method uncompress.");
}
return toReturn;
}