--- old/src/java.desktop/share/classes/sun/awt/FontDescriptor.java 2015-06-11 19:09:27.391659800 +0300 +++ new/src/java.desktop/share/classes/sun/awt/FontDescriptor.java 2015-06-11 19:09:26.854552400 +0300 @@ -24,8 +24,8 @@ */ package sun.awt; -import java.io.ByteArrayInputStream; -import java.io.InputStreamReader; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; import java.io.IOException;; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; @@ -54,8 +54,7 @@ // The following looks odd but its the only public way to get the // historical name if one exists and the canonical name otherwise. try { - ByteArrayInputStream bais = new ByteArrayInputStream(new byte[8]); - InputStreamReader isr = new InputStreamReader(bais, cs); + OutputStreamWriter isr = new OutputStreamWriter(new ByteArrayOutputStream(), cs); this.charsetName = isr.getEncoding(); isr.close(); } catch (IOException ioe) {