/** * Returns a charset object for the given charset name. * @throws NullPointerException is csn is null * @throws UnsupportedEncodingException if the charset is not supported */ private static Charset toCharset(String csn) throws UnsupportedEncodingException { return PrintStream.toCharset(csn); }
/** * Returns a charset object for the given charset name. * @throws NullPointerException is csn is null * @throws UnsupportedEncodingException if the charset is not supported */ private static Charset toCharset(String csn) throws UnsupportedEncodingException { return PrintStream.toCharset(csn); }
/** * Creates a new print stream. * * @param out The output stream to which values and objects will be * printed * @param autoFlush A boolean; if true, the output buffer will be flushed * whenever a byte array is written, one of the * <code>println</code> methods is invoked, or a newline * character or byte (<code>'\n'</code>) is written * @param encoding The name of a supported * <a href="../lang/package-summary.html#charenc"> * character encoding</a> * * @throws UnsupportedEncodingException * If the named encoding is not supported * * @since 1.4 */ public PrintStream(OutputStream out, boolean autoFlush, String encoding) throws UnsupportedEncodingException { this(autoFlush, requireNonNull(out, "Null output stream"), toCharset(encoding)); }
/** * Creates a new print stream. * * @param out The output stream to which values and objects will be * printed * @param autoFlush A boolean; if true, the output buffer will be flushed * whenever a byte array is written, one of the * <code>println</code> methods is invoked, or a newline * character or byte (<code>'\n'</code>) is written * @param encoding The name of a supported * <a href="../lang/package-summary.html#charenc"> * character encoding</a> * * @throws UnsupportedEncodingException * If the named encoding is not supported * * @since 1.4 */ public PrintStream(OutputStream out, boolean autoFlush, String encoding) throws UnsupportedEncodingException { this(autoFlush, requireNonNull(out, "Null output stream"), toCharset(encoding)); }