src/java.base/share/classes/java/io/InputStreamReader.java

Print this page




 162      * @return The character read, or -1 if the end of the stream has been
 163      *         reached
 164      *
 165      * @exception  IOException  If an I/O error occurs
 166      */
 167     public int read() throws IOException {
 168         return sd.read();
 169     }
 170 
 171     /**
 172      * Reads characters into a portion of an array.
 173      *
 174      * @param      cbuf     Destination buffer
 175      * @param      offset   Offset at which to start storing characters
 176      * @param      length   Maximum number of characters to read
 177      *
 178      * @return     The number of characters read, or -1 if the end of the
 179      *             stream has been reached
 180      *
 181      * @exception  IOException  If an I/O error occurs

 182      */
 183     public int read(char cbuf[], int offset, int length) throws IOException {
 184         return sd.read(cbuf, offset, length);
 185     }
 186 
 187     /**
 188      * Tells whether this stream is ready to be read.  An InputStreamReader is
 189      * ready if its input buffer is not empty, or if bytes are available to be
 190      * read from the underlying byte stream.
 191      *
 192      * @exception  IOException  If an I/O error occurs
 193      */
 194     public boolean ready() throws IOException {
 195         return sd.ready();
 196     }
 197 
 198     public void close() throws IOException {
 199         sd.close();
 200     }
 201 }


 162      * @return The character read, or -1 if the end of the stream has been
 163      *         reached
 164      *
 165      * @exception  IOException  If an I/O error occurs
 166      */
 167     public int read() throws IOException {
 168         return sd.read();
 169     }
 170 
 171     /**
 172      * Reads characters into a portion of an array.
 173      *
 174      * @param      cbuf     Destination buffer
 175      * @param      offset   Offset at which to start storing characters
 176      * @param      length   Maximum number of characters to read
 177      *
 178      * @return     The number of characters read, or -1 if the end of the
 179      *             stream has been reached
 180      *
 181      * @exception  IOException  If an I/O error occurs
 182      * @exception  IndexOutOfBoundsException {@inheritDoc}
 183      */
 184     public int read(char cbuf[], int offset, int length) throws IOException {
 185         return sd.read(cbuf, offset, length);
 186     }
 187 
 188     /**
 189      * Tells whether this stream is ready to be read.  An InputStreamReader is
 190      * ready if its input buffer is not empty, or if bytes are available to be
 191      * read from the underlying byte stream.
 192      *
 193      * @exception  IOException  If an I/O error occurs
 194      */
 195     public boolean ready() throws IOException {
 196         return sd.ready();
 197     }
 198 
 199     public void close() throws IOException {
 200         sd.close();
 201     }
 202 }