ZipoutputStream Reading/ adding zip file comments

Discussion in 'Java' started by Claudio Barradas, Jun 22, 2004.

  1. 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
     
    Claudio Barradas, Jun 22, 2004
    #1
    1. Advertising

  2. Claudio  Barradas

    Roedy Green Guest

    On Tue, 22 Jun 2004 23:51:57 +0100, "Claudio Barradas"
    <> wrote or quoted :

    >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.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jun 23, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JScoobyCed

    ZipOutputStream and binary data

    JScoobyCed, Jun 23, 2004, in forum: Java
    Replies:
    13
    Views:
    1,011
    JScoobyCed
    Jun 25, 2004
  2. C B
    Replies:
    4
    Views:
    4,619
    Chris Uppal
    Nov 10, 2004
  3. abcd
    Replies:
    7
    Views:
    532
    Edward Elliott
    May 1, 2006
  4. VijayV
    Replies:
    2
    Views:
    638
    Roedy Green
    Apr 11, 2008
  5. Erik

    ZipOutputStream

    Erik, Jan 25, 2010, in forum: Java
    Replies:
    14
    Views:
    3,097
Loading...

Share This Page