File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Recovery from corrupt GZIP file

 
BAPPA BAPPA
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was writing in GZIP format during which JVM crashed. So the file was corrupted and when I tried to read from the file it said, "Unexpected End of ZLIB ...". Is there any way

1. to recover these types of GZIP files?
2. to handle kill -9 signal using java
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kill -9 kills the process without giving it a chance to close gracefully. If you use a less abrupt method to close your application then you can use shutdown hooks.

I don't think the file can be recovered.
 
BAPPA BAPPA
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i wanna recover any corrupt gzip file what should i do while reading?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"download managers" keep track of the number of bytes sent to the client and then if the connection is reset, they send a HTTP request asking to restart from the point the previous request stopped. I guess you would need to look closer into this and implement it in Java.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi BAPPA BAPPA,

Welcome to JavaRanch!

We have a strict policy on display names, which must be a real first and last name with a space between.

Please go here and fix your display name up, pronto. Thanks, pardner!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic