The method setComment(String) in java.util.zip.ZipOutputStream can put comment to the zip file that I made, but how can I get back the comment from the zip file? There is no such a method getComment() in the class java.util.zip.ZipInputStream or any other zip classes.
Yes, ZipEntry has setComments and getComments methods, but those are for a particular entry, not for the file as a whole (which is what Haiqiang is asking about).
Looking at the source, it seems that the comments written by ZipOutputStream.setComments do not seem to get read by ZipInputStream - they're part of a file footer, so to speak, that follows the last entry, and which is disregarded upon reading.
I believe that the comment set by setComment() can be read by some advanced Archiving Softwares like Winzip, but really I don't know how it might be possible to read the comment using the java.util.zip package.
Post by:autobot
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
a bit of art, as a gift, that will fit in a stocking