< prev index next >

src/java.base/share/classes/java/io/InputStreamReader.java

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

@@ -68,16 +68,12 @@
      *
      * @param  in   An InputStream
      */
     public InputStreamReader(InputStream in) {
         super(in);
-        try {
-            sd = StreamDecoder.forInputStreamReader(in, this, (String)null); // ## check lock object
-        } catch (UnsupportedEncodingException e) {
-            // The default encoding should always be available
-            throw new Error(e);
-        }
+        sd = StreamDecoder.forInputStreamReader(in, this,
+                Charset.defaultCharset()); // ## check lock object
     }
 
     /**
      * Creates an InputStreamReader that uses the named charset.
      *
< prev index next >