Java Reference
In-Depth Information
public int read() throws IOException
Reads a single character and returns it as an integer in the
range 0 to 65535. If no character is available because the end
of the stream has been reached, the value 1 is returned. This
method blocks until input is available, the end of stream is
found, or an exception is thrown.
public abstract int read(char[] buf, int offset, int count) throws
IOException
Reads into a part of a char array. The maximum number of
characters to read is count . The read characters are stored
from buf[offset] up to a maximum of buf[offset+count-1] all
other values in buf are left unchanged. The number of char-
acters actually read is returned. If no characters are read be-
cause the end of the stream was found, 1 is returned. If count
is zero then no characters are read and zero is returned. This
method blocks until input is available, the end of stream is
found, or an exception is thrown. If the first character can-
not be read for any reason other than finding the end of the
streamin particular, if the stream has already been closedan
IOException is thrown. Once a character has been read, any
failure that occurs while trying to read characters does not
cause an exception, but is treated just like finding the end
of the streamthe method completes normally and returns the
number of characters read before the failure occurred.
public int read(char[] buf) tHRows IOException
Equivalent to read(buf,0, buf.length) .
public int read(java.nio.CharBuffer buf) throws IOException
Attempts to read as many characters as possible into the spe-
cified character buffer, without overflowing it. The number
of characters actually read is returned. If no characters are
 
Search WWH ::




Custom Search