/// <summary> /// Creates an InputStreamReader that uses the named charset. /// </summary> /// <param name="in"> /// An InputStream /// </param> /// <param name="charsetName"> /// The name of a supported /// <seealso cref="java.nio.charset.Charset charset"/> /// </param> /// <exception cref="UnsupportedEncodingException"> /// If the named charset is not supported </exception> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public InputStreamReader(InputStream in, String charsetName) throws UnsupportedEncodingException public InputStreamReader(InputStream @in, String charsetName) : base(@in) { if (charsetName == null) { throw new NullPointerException("charsetName"); } Sd = StreamDecoder.forInputStreamReader(@in, this, charsetName); }
/// <summary> /// Creates an InputStreamReader that uses the given charset decoder. /// </summary> /// <param name="in"> An InputStream </param> /// <param name="dec"> A charset decoder /// /// @since 1.4 /// @spec JSR-51 </param> public InputStreamReader(InputStream @in, CharsetDecoder dec) : base(@in) { if (dec == null) { throw new NullPointerException("charset decoder"); } Sd = StreamDecoder.forInputStreamReader(@in, this, dec); }
/// <summary> /// Creates an InputStreamReader that uses the given charset. /// </summary> /// <param name="in"> An InputStream </param> /// <param name="cs"> A charset /// /// @since 1.4 /// @spec JSR-51 </param> public InputStreamReader(InputStream @in, Charset cs) : base(@in) { if (cs == null) { throw new NullPointerException("charset"); } Sd = StreamDecoder.forInputStreamReader(@in, this, cs); }
/// <summary> /// Creates an InputStreamReader that uses the default charset. /// </summary> /// <param name="in"> An InputStream </param> public InputStreamReader(InputStream @in) : base(@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); } }