} private static final String encprop = "sun.jnu.encoding"; private static String encoding = null; private static boolean isCharsetSupported = false; /* * converts a c or a byte array to a platform specific string, * previously implemented as a native method in the launcher. */ static String makePlatformString(boolean printToStderr, byte[] inArray) { final PrintStream ostream = (printToStderr) ? System.err : System.out; if (encoding == null) { encoding = System.getProperty(encprop); isCharsetSupported = Charset.isSupported(encoding); } try { String out = isCharsetSupported ? new String(inArray, encoding) : new String(inArray); return out; } catch (UnsupportedEncodingException uee) { abort(ostream, uee, null); } return null; // keep the compiler happy }}Lines 501–527 of 527. Previous lines
} private static final String encprop = "sun.jnu.encoding"; private static String encoding = null; private static boolean isCharsetSupported = false; /* * converts a c or a byte array to a platform specific string, * previously implemented as a native method in the launcher. */ static String makePlatformString(boolean printToStderr, byte[] inArray) { final PrintStream ostream = (printToStderr) ? System.err : System.out; if (encoding == null) { encoding = System.getProperty(encprop); isCharsetSupported = Charset.isSupported(encoding); } try { String out = isCharsetSupported ? new String(inArray, encoding) : new String(inArray); return out; } catch (UnsupportedEncodingException uee) { abort(ostream, uee, null); } return null; // keep the compiler happy } }