< prev index next >

src/java.base/share/classes/java/util/Properties.java

Print this page
rev 57116 : 8234147: Avoid looking up standard charsets in core libraries
Reviewed-by: alanb

@@ -44,10 +44,12 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.BiConsumer;
 import java.util.function.BiFunction;
 import java.util.function.Function;
 
+import sun.nio.cs.ISO_8859_1;
+
 import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.Unsafe;
 import jdk.internal.util.ArraysSupport;
 import jdk.internal.util.xml.PropertiesDefaultHandler;
 

@@ -907,11 +909,11 @@
      * @since 1.2
      */
     public void store(OutputStream out, String comments)
         throws IOException
     {
-        store0(new BufferedWriter(new OutputStreamWriter(out, "8859_1")),
+        store0(new BufferedWriter(new OutputStreamWriter(out, ISO_8859_1.INSTANCE)),
                comments,
                true);
     }
 
     private void store0(BufferedWriter bw, String comments, boolean escUnicode)
< prev index next >