< prev index next >

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

Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea

*** 93,103 **** * the specified size. * * @param in A Reader * @param sz Input-buffer size * ! * @exception IllegalArgumentException If {@code sz <= 0} */ public BufferedReader(Reader in, int sz) { super(in); if (sz <= 0) throw new IllegalArgumentException("Buffer size <= 0"); --- 93,103 ---- * the specified size. * * @param in A Reader * @param sz Input-buffer size * ! * @throws IllegalArgumentException If {@code sz <= 0} */ public BufferedReader(Reader in, int sz) { super(in); if (sz <= 0) throw new IllegalArgumentException("Buffer size <= 0");
*** 170,180 **** * Reads a single character. * * @return The character read, as an integer in the range * 0 to 65535 ({@code 0x00-0xffff}), or -1 if the * end of the stream has been reached ! * @exception IOException If an I/O error occurs */ public int read() throws IOException { synchronized (lock) { ensureOpen(); for (;;) { --- 170,180 ---- * Reads a single character. * * @return The character read, as an integer in the range * 0 to 65535 ({@code 0x00-0xffff}), or -1 if the * end of the stream has been reached ! * @throws IOException If an I/O error occurs */ public int read() throws IOException { synchronized (lock) { ensureOpen(); for (;;) {
*** 269,280 **** * @param len Maximum number of characters to read * * @return The number of characters read, or -1 if the end of the * stream has been reached * ! * @exception IOException If an I/O error occurs ! * @exception IndexOutOfBoundsException {@inheritDoc} */ public int read(char cbuf[], int off, int len) throws IOException { synchronized (lock) { ensureOpen(); if ((off < 0) || (off > cbuf.length) || (len < 0) || --- 269,280 ---- * @param len Maximum number of characters to read * * @return The number of characters read, or -1 if the end of the * stream has been reached * ! * @throws IOException If an I/O error occurs ! * @throws IndexOutOfBoundsException {@inheritDoc} */ public int read(char cbuf[], int off, int len) throws IOException { synchronized (lock) { ensureOpen(); if ((off < 0) || (off > cbuf.length) || (len < 0) ||
*** 309,319 **** * any line-termination characters, or null if the end of the * stream has been reached without reading any characters * * @see java.io.LineNumberReader#readLine() * ! * @exception IOException If an I/O error occurs */ String readLine(boolean ignoreLF, boolean[] term) throws IOException { StringBuffer s = null; int startChar; --- 309,319 ---- * any line-termination characters, or null if the end of the * stream has been reached without reading any characters * * @see java.io.LineNumberReader#readLine() * ! * @throws IOException If an I/O error occurs */ String readLine(boolean ignoreLF, boolean[] term) throws IOException { StringBuffer s = null; int startChar;
*** 386,396 **** * * @return A String containing the contents of the line, not including * any line-termination characters, or null if the end of the * stream has been reached without reading any characters * ! * @exception IOException If an I/O error occurs * * @see java.nio.file.Files#readAllLines */ public String readLine() throws IOException { return readLine(false, null); --- 386,396 ---- * * @return A String containing the contents of the line, not including * any line-termination characters, or null if the end of the * stream has been reached without reading any characters * ! * @throws IOException If an I/O error occurs * * @see java.nio.file.Files#readAllLines */ public String readLine() throws IOException { return readLine(false, null);
*** 401,412 **** * * @param n The number of characters to skip * * @return The number of characters actually skipped * ! * @exception IllegalArgumentException If <code>n</code> is negative. ! * @exception IOException If an I/O error occurs */ public long skip(long n) throws IOException { if (n < 0L) { throw new IllegalArgumentException("skip value is negative"); } --- 401,412 ---- * * @param n The number of characters to skip * * @return The number of characters actually skipped * ! * @throws IllegalArgumentException If <code>n</code> is negative. ! * @throws IOException If an I/O error occurs */ public long skip(long n) throws IOException { if (n < 0L) { throw new IllegalArgumentException("skip value is negative"); }
*** 442,452 **** /** * Tells whether this stream is ready to be read. A buffered character * stream is ready if the buffer is not empty, or if the underlying * character stream is ready. * ! * @exception IOException If an I/O error occurs */ public boolean ready() throws IOException { synchronized (lock) { ensureOpen(); --- 442,452 ---- /** * Tells whether this stream is ready to be read. A buffered character * stream is ready if the buffer is not empty, or if the underlying * character stream is ready. * ! * @throws IOException If an I/O error occurs */ public boolean ready() throws IOException { synchronized (lock) { ensureOpen();
*** 489,500 **** * A limit value larger than the size of the input * buffer will cause a new buffer to be allocated * whose size is no smaller than limit. * Therefore large values should be used with care. * ! * @exception IllegalArgumentException If {@code readAheadLimit < 0} ! * @exception IOException If an I/O error occurs */ public void mark(int readAheadLimit) throws IOException { if (readAheadLimit < 0) { throw new IllegalArgumentException("Read-ahead limit < 0"); } --- 489,500 ---- * A limit value larger than the size of the input * buffer will cause a new buffer to be allocated * whose size is no smaller than limit. * Therefore large values should be used with care. * ! * @throws IllegalArgumentException If {@code readAheadLimit < 0} ! * @throws IOException If an I/O error occurs */ public void mark(int readAheadLimit) throws IOException { if (readAheadLimit < 0) { throw new IllegalArgumentException("Read-ahead limit < 0"); }
*** 507,517 **** } /** * Resets the stream to the most recent mark. * ! * @exception IOException If the stream has never been marked, * or if the mark has been invalidated */ public void reset() throws IOException { synchronized (lock) { ensureOpen(); --- 507,517 ---- } /** * Resets the stream to the most recent mark. * ! * @throws IOException If the stream has never been marked, * or if the mark has been invalidated */ public void reset() throws IOException { synchronized (lock) { ensureOpen();
< prev index next >