Guys, testing my tar.gz extraction tool, I found an exception:
java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill (Unknown Source)
at java.util.zip.InflaterInputStream.read (Unknown Source)
at java.util.zip.GZIPInputStream.read (Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes (Unknown Source)
at sun.nio.cs.StreamDecoder.implRead (Unknown Source)
at sun.nio.cs.StreamDecoder.read (Unknown Source)
at java.io.InputStreamReader.read (Unknown Source)
at java.io.BufferedReader.fill (Unknown Source)
at java.io.BufferedReader.readLine (Unknown Source)
at java.io.BufferedReader.readLine (Unknown Source)
at it.uniroma2.informatica.specialistica.IO.ScanCompressedFileUtil.main (ScanCompressedFileUtil.java:60
So the code on line 60 is:
BufferedReader bufLe= reader.remove();
try {
while ( bufLe.ready() ){
System.out.println(" "+bufLe.readLine());
}
} catch (IOException e) {
e.printStackTrace();
}
where a call to buffer.readLine () throws an exception. When I open tar.gz, I saved the stream of just one file, such as BuffReader, then I put them in a linked List, and then I closed the buffer of the tar.gz file. But when I type in an item in a linked list and then try to read line by line. I have a performance.
SOmeOne has an IDEa, why do I have an exception ??? Maybe I'm wrong when I iterate over files in tar.gz? for this i have code:
TarInputStream is = new TarInputStream(gzipInputStream);
TarEntry entryx = null;
try {
while((entryx = is.getNextEntry()) != null) {
InputStream tmpInx = new StreamingTarEntry(is, entryx.getSize());
manageTxtinsideTAR(tmpInx , buffer);
The STREAMINGTARENTRY class extends FilterInputStream, so it only wraps the stream.
source
share