2362N/A * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * An InputStreamReader is a bridge from byte streams to character streams: It 0N/A * reads bytes and decodes them into characters using a specified {@link 0N/A * java.nio.charset.Charset <code>charset</code>}. The charset that it uses 0N/A * may be specified by name or may be given explicitly, or the platform's 0N/A * default charset may be accepted. 0N/A * <p> Each invocation of one of an InputStreamReader's read() methods may 0N/A * cause one or more bytes to be read from the underlying byte-input stream. 0N/A * To enable the efficient conversion of bytes to characters, more bytes may 0N/A * be read ahead from the underlying stream than are necessary to satisfy the 0N/A * current read operation. 0N/A * <p> For top efficiency, consider wrapping an InputStreamReader within a 0N/A * BufferedReader. For example: 0N/A * = new BufferedReader(new InputStreamReader(System.in)); 0N/A * @see BufferedReader 0N/A * @see java.nio.charset.Charset 0N/A * @author Mark Reinhold 0N/A * Creates an InputStreamReader that uses the default charset. 0N/A * @param in An InputStream 0N/A // The default encoding should always be available 0N/A * Creates an InputStreamReader that uses the named charset. 0N/A * @param charsetName 0N/A * The name of a supported 0N/A * {@link java.nio.charset.Charset </code>charset<code>} 0N/A * @exception UnsupportedEncodingException 0N/A * If the named charset is not supported 0N/A * Creates an InputStreamReader that uses the given charset. </p> 0N/A * @param in An InputStream 0N/A * @param cs A charset 0N/A * Creates an InputStreamReader that uses the given charset decoder. </p> 0N/A * @param in An InputStream 0N/A * @param dec A charset decoder 0N/A * Returns the name of the character encoding being used by this stream. 0N/A * <p> If the encoding has an historical name then that name is returned; 0N/A * otherwise the encoding's canonical name is returned. 0N/A * <p> If this instance was created with the {@link 0N/A * #InputStreamReader(InputStream, String)} constructor then the returned 0N/A * name, being unique for the encoding, may differ from the name passed to 0N/A * the constructor. This method will return <code>null</code> if the 0N/A * stream has been closed. 0N/A * @return The historical name of this encoding, or 0N/A * <code>null</code> if the stream has been closed 0N/A * @see java.nio.charset.Charset 0N/A * Reads a single character. 0N/A * @return The character read, or -1 if the end of the stream has been 0N/A * @exception IOException If an I/O error occurs 0N/A * Reads characters into a portion of an array. 0N/A * @param cbuf Destination buffer 0N/A * @param offset Offset at which to start storing characters 0N/A * @param length Maximum number of characters to read 0N/A * @return The number of characters read, or -1 if the end of the 0N/A * stream has been reached 0N/A * @exception IOException If an I/O error occurs 0N/A * Tells whether this stream is ready to be read. An InputStreamReader is 0N/A * ready if its input buffer is not empty, or if bytes are available to be 0N/A * read from the underlying byte stream. 0N/A * @exception IOException If an I/O error occurs