src/share/classes/java/util/zip/ZipOutputStream.java

Print this page
rev 3975 : 4884238: Adds java.nio.charset.StandardCharset to provide static final constants for the standard charsets.

@@ -26,10 +26,11 @@
 package java.util.zip;
 
 import java.io.OutputStream;
 import java.io.IOException;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharset;
 import java.util.Vector;
 import java.util.HashSet;
 import static java.util.zip.ZipConstants64.*;
 
 /**

@@ -98,11 +99,11 @@
      * to encode the entry names and comments.
      *
      * @param out the actual output stream
      */
     public ZipOutputStream(OutputStream out) {
-        this(out, Charset.forName("UTF-8"));
+        this(out, StandardCharset.UTF_8);
     }
 
     /**
      * Creates a new ZIP output stream.
      *