diff options
| author | John Leuner <jewel@pixie.co.za> | 2002-05-30 18:50:40 +0000 |
|---|---|---|
| committer | John Leuner <jewel@pixie.co.za> | 2002-05-30 18:50:40 +0000 |
| commit | be784d5fd3902e5b365605fbdac7182ed4dab7e8 (patch) | |
| tree | 03b2c3570c3b84c2d3a350d63c75d496e8634291 /java/util/zip/ZipOutputStream.java | |
| parent | cbe5e9b4dc626e1e15af397c4c62bfecb3e828f2 (diff) | |
| download | classpath-be784d5fd3902e5b365605fbdac7182ed4dab7e8.tar.gz | |
java/util/zip/*java: Changed to use default character
encoding instead of UTF8 for zip comments.
lib/jazzlib/makeJazzlibDist.sh: Changed to use zsh.
Builds .zip and .jar files too.
Diffstat (limited to 'java/util/zip/ZipOutputStream.java')
| -rw-r--r-- | java/util/zip/ZipOutputStream.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/java/util/zip/ZipOutputStream.java b/java/util/zip/ZipOutputStream.java index c7a1f74de..e4fb864a9 100644 --- a/java/util/zip/ZipOutputStream.java +++ b/java/util/zip/ZipOutputStream.java @@ -94,20 +94,13 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant /** * Set the zip file comment. * @param comment the comment. - * @exception IllegalArgumentException if UTF8 encoding of comment is + * @exception IllegalArgumentException if encoding of comment is * longer than 0xffff bytes. */ public void setComment(String comment) { byte[] commentBytes; - try - { - commentBytes = comment.getBytes("UTF8"); - } - catch (UnsupportedEncodingException ex) - { - throw new InternalError("UTF8 encoding not found"); - } + commentBytes = comment.getBytes(); if (commentBytes.length > 0xffff) throw new IllegalArgumentException("Comment too long."); zipComment = commentBytes; @@ -231,7 +224,7 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant writeLeInt(0); writeLeInt(0); } - byte[] name = entry.getName().getBytes("UTF8"); + byte[] name = entry.getName().getBytes(); if (name.length > 0xffff) throw new ZipException("Name too long."); byte[] extra = entry.getExtra(); @@ -362,7 +355,7 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant writeLeInt((int)entry.getCompressedSize()); writeLeInt((int)entry.getSize()); - byte[] name = entry.getName().getBytes("UTF8"); + byte[] name = entry.getName().getBytes(); if (name.length > 0xffff) throw new ZipException("Name too long."); byte[] extra = entry.getExtra(); @@ -370,7 +363,7 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant extra = new byte[0]; String strComment = entry.getComment(); byte[] comment = strComment != null - ? strComment.getBytes("UTF8") : new byte[0]; + ? strComment.getBytes() : new byte[0]; if (comment.length > 0xffff) throw new ZipException("Comment too long."); |
