< prev index next >

src/java.base/share/classes/java/io/PushbackInputStream.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

*** 82,92 **** * <code>in</code>, for later use. Initially, * the pushback buffer is empty. * * @param in the input stream from which bytes will be read. * @param size the size of the pushback buffer. ! * @exception IllegalArgumentException if {@code size <= 0} * @since 1.1 */ public PushbackInputStream(InputStream in, int size) { super(in); if (size <= 0) { --- 82,92 ---- * <code>in</code>, for later use. Initially, * the pushback buffer is empty. * * @param in the input stream from which bytes will be read. * @param size the size of the pushback buffer. ! * @throws IllegalArgumentException if {@code size <= 0} * @since 1.1 */ public PushbackInputStream(InputStream in, int size) { super(in); if (size <= 0) {
*** 121,131 **** * one, and otherwise calls the <code>read</code> method of its underlying * input stream and returns whatever value that method returns. * * @return the next byte of data, or <code>-1</code> if the end of the * stream has been reached. ! * @exception IOException if this input stream has been closed by * invoking its {@link #close()} method, * or an I/O error occurs. * @see java.io.InputStream#read() */ public int read() throws IOException { --- 121,131 ---- * one, and otherwise calls the <code>read</code> method of its underlying * input stream and returns whatever value that method returns. * * @return the next byte of data, or <code>-1</code> if the end of the * stream has been reached. ! * @throws IOException if this input stream has been closed by * invoking its {@link #close()} method, * or an I/O error occurs. * @see java.io.InputStream#read() */ public int read() throws IOException {
*** 148,162 **** * @param off the start offset in the destination array <code>b</code> * @param len the maximum number of bytes read. * @return the total number of bytes read into the buffer, or * <code>-1</code> if there is no more data because the end of * the stream has been reached. ! * @exception NullPointerException If <code>b</code> is <code>null</code>. ! * @exception IndexOutOfBoundsException If <code>off</code> is negative, * <code>len</code> is negative, or <code>len</code> is greater than * <code>b.length - off</code> ! * @exception IOException if this input stream has been closed by * invoking its {@link #close()} method, * or an I/O error occurs. * @see java.io.InputStream#read(byte[], int, int) */ public int read(byte[] b, int off, int len) throws IOException { --- 148,162 ---- * @param off the start offset in the destination array <code>b</code> * @param len the maximum number of bytes read. * @return the total number of bytes read into the buffer, or * <code>-1</code> if there is no more data because the end of * the stream has been reached. ! * @throws NullPointerException If <code>b</code> is <code>null</code>. ! * @throws IndexOutOfBoundsException If <code>off</code> is negative, * <code>len</code> is negative, or <code>len</code> is greater than * <code>b.length - off</code> ! * @throws IOException if this input stream has been closed by * invoking its {@link #close()} method, * or an I/O error occurs. * @see java.io.InputStream#read(byte[], int, int) */ public int read(byte[] b, int off, int len) throws IOException {
*** 194,204 **** * After this method returns, the next byte to be read will have the value * <code>(byte)b</code>. * * @param b the <code>int</code> value whose low-order * byte is to be pushed back. ! * @exception IOException If there is not enough room in the pushback * buffer for the byte, or this input stream has been closed by * invoking its {@link #close()} method. */ public void unread(int b) throws IOException { ensureOpen(); --- 194,204 ---- * After this method returns, the next byte to be read will have the value * <code>(byte)b</code>. * * @param b the <code>int</code> value whose low-order * byte is to be pushed back. ! * @throws IOException If there is not enough room in the pushback * buffer for the byte, or this input stream has been closed by * invoking its {@link #close()} method. */ public void unread(int b) throws IOException { ensureOpen();
*** 215,226 **** * have the value <code>b[off+1]</code>, and so forth. * * @param b the byte array to push back. * @param off the start offset of the data. * @param len the number of bytes to push back. ! * @exception NullPointerException If <code>b</code> is <code>null</code>. ! * @exception IOException If there is not enough room in the pushback * buffer for the specified number of bytes, * or this input stream has been closed by * invoking its {@link #close()} method. * @since 1.1 */ --- 215,226 ---- * have the value <code>b[off+1]</code>, and so forth. * * @param b the byte array to push back. * @param off the start offset of the data. * @param len the number of bytes to push back. ! * @throws NullPointerException If <code>b</code> is <code>null</code>. ! * @throws IOException If there is not enough room in the pushback * buffer for the specified number of bytes, * or this input stream has been closed by * invoking its {@link #close()} method. * @since 1.1 */
*** 238,249 **** * pushback buffer. After this method returns, the next byte to be read * will have the value <code>b[0]</code>, the byte after that will have the * value <code>b[1]</code>, and so forth. * * @param b the byte array to push back ! * @exception NullPointerException If <code>b</code> is <code>null</code>. ! * @exception IOException If there is not enough room in the pushback * buffer for the specified number of bytes, * or this input stream has been closed by * invoking its {@link #close()} method. * @since 1.1 */ --- 238,249 ---- * pushback buffer. After this method returns, the next byte to be read * will have the value <code>b[0]</code>, the byte after that will have the * value <code>b[1]</code>, and so forth. * * @param b the byte array to push back ! * @throws NullPointerException If <code>b</code> is <code>null</code>. ! * @throws IOException If there is not enough room in the pushback * buffer for the specified number of bytes, * or this input stream has been closed by * invoking its {@link #close()} method. * @since 1.1 */
*** 262,272 **** * pushed back and the value returned by {@link * java.io.FilterInputStream#available available}. * * @return the number of bytes that can be read (or skipped over) from * the input stream without blocking. ! * @exception IOException if this input stream has been closed by * invoking its {@link #close()} method, * or an I/O error occurs. * @see java.io.FilterInputStream#in * @see java.io.InputStream#available() */ --- 262,272 ---- * pushed back and the value returned by {@link * java.io.FilterInputStream#available available}. * * @return the number of bytes that can be read (or skipped over) from * the input stream without blocking. ! * @throws IOException if this input stream has been closed by * invoking its {@link #close()} method, * or an I/O error occurs. * @see java.io.FilterInputStream#in * @see java.io.InputStream#available() */
*** 353,363 **** * * <p> The method <code>reset</code> for class * <code>PushbackInputStream</code> does nothing except throw an * <code>IOException</code>. * ! * @exception IOException if this method is invoked. * @see java.io.InputStream#mark(int) * @see java.io.IOException */ public synchronized void reset() throws IOException { throw new IOException("mark/reset not supported"); --- 353,363 ---- * * <p> The method <code>reset</code> for class * <code>PushbackInputStream</code> does nothing except throw an * <code>IOException</code>. * ! * @throws IOException if this method is invoked. * @see java.io.InputStream#mark(int) * @see java.io.IOException */ public synchronized void reset() throws IOException { throw new IOException("mark/reset not supported");
*** 368,378 **** * associated with the stream. * Once the stream has been closed, further read(), unread(), * available(), reset(), or skip() invocations will throw an IOException. * Closing a previously closed stream has no effect. * ! * @exception IOException if an I/O error occurs. */ public synchronized void close() throws IOException { if (in == null) return; in.close(); --- 368,378 ---- * associated with the stream. * Once the stream has been closed, further read(), unread(), * available(), reset(), or skip() invocations will throw an IOException. * Closing a previously closed stream has no effect. * ! * @throws IOException if an I/O error occurs. */ public synchronized void close() throws IOException { if (in == null) return; in.close();
< prev index next >