Hi,
I am trying to unzip a standard zip file.  I have copied a couple
standard java unzip classes from web searches but each time it creates
a JRE parsing error.  Does anyone have ideas on what is wrong or how I
can do differently?

Thanks,
Bob

Error:

# An unexpected error has been detected by Java Runtime Environment:
#
#  Internal Error (classFileParser.cpp:2924), pid=3624, tid=6748
#  Error: ShouldNotReachHere()
#
# Java VM: Java HotSpot(TM) Client VM (10.0-b23 mixed mode windows-
x86)
# An error report file with more information is saved as:
# G:\TestWebView\hs_err_pid3624.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp


Code:
public class Unzip
{
  public static void main(String[] args)
  {
    if (args.length != 1) {
      System.out.println("Usage: java Unzip zipfile");
      System.exit(1);
    }
    try {
      byte[] buf = new byte[4096];
      ZipInputStream in = new ZipInputStream(
                          new FileInputStream(args[0]));
      while (true) {
        //Nächsten Eintrag lesen
        ZipEntry entry = in.getNextEntry();
        if (entry == null) {
          break;
        }
        //Beschreibung ausgeben
        System.out.println(
          entry.getName() +
          " (" + entry.getCompressedSize() + "/" +
          entry.getSize() + ")"
        );
        //Ausgabedatei erzeugen
        FileOutputStream out = new FileOutputStream(
          entry.getName()
        );
        int len;
        while ((len = in.read(buf)) > 0) {
          out.write(buf, 0, len);
        }
        out.close();
        //Eintrag schließen
        in.closeEntry();
      }
      in.close();
    } catch (IOException e) {
      System.err.println(e.toString());
    }
  }
}



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to