ZipoutputStream Reading/ adding zip file comments

C

Claudio Barradas

hi!
i'm trying to put comments on zip files using Zip out put stream.
i've tried two ways:

1-
ZipOutputStream out = new ZipOutputStream(new
BufferedOutputStream(checksum));
out.setComment(comment);

I can write the commnent, but there is no way to read it then.

2-
ZipEntry entry = new ZipEntry("filename");
entry.setComment(comment);

i set the comment! but it is not keeped in zip file. When i try to read it
entry.getComment(); always return null!

please help me
 
R

Roedy Green

1-
ZipOutputStream out = new ZipOutputStream(new
BufferedOutputStream(checksum));
out.setComment(comment);

I can write the commnent, but there is no way to read it then.

2-
ZipEntry entry = new ZipEntry("filename");
entry.setComment(comment);

i set the comment! but it is not keeped in zip file. When i try to read it
entry.getComment(); always return null!

try looking at the file generated with a hex viewer or Winzip. Then
you can tell if the problem is in the reading or writing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top