• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to I write objects into a gzip file?

 
Andrew Symantec
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Can somebody help me to find a way to write objects into a gzip file? I've tried ObjectOutputStream and GZIPOutputStream, it doesn't work me. An example would be really helpful.

Cheers,
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "it doesn't work" mean? What have you tried and how did it not work?
 
Andrew Symantec
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf Dittmer,

I figured out what is wrong. My program is writing large number of objects to the compressed file, sometimes I need to terminate the program by hitting "Ctrl+C". I found whenever I terminate my program this way, the generated .gzip file is corrupted. Then I figured out I need to handle the "Ctrl+C" signal and do some clean up work, so the stream can be closed properly.

thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!