< prev index next >

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

*** 1,7 **** /* ! * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 74,84 **** * that it is connected to the piped writer * <code>src</code>. Data written to <code>src</code> * will then be available as input from this stream. * * @param src the stream to connect to. ! * @exception IOException if an I/O error occurs. */ public PipedReader(PipedWriter src) throws IOException { this(src, DEFAULT_PIPE_SIZE); } --- 74,84 ---- * that it is connected to the piped writer * <code>src</code>. Data written to <code>src</code> * will then be available as input from this stream. * * @param src the stream to connect to. ! * @throws IOException if an I/O error occurs. */ public PipedReader(PipedWriter src) throws IOException { this(src, DEFAULT_PIPE_SIZE); }
*** 88,99 **** * pipe size for the pipe's buffer. Data written to <code>src</code> * will then be available as input from this stream. * @param src the stream to connect to. * @param pipeSize the size of the pipe's buffer. ! * @exception IOException if an I/O error occurs. ! * @exception IllegalArgumentException if {@code pipeSize <= 0}. * @since 1.6 */ public PipedReader(PipedWriter src, int pipeSize) throws IOException { initPipe(pipeSize); connect(src); --- 88,99 ---- * pipe size for the pipe's buffer. Data written to <code>src</code> * will then be available as input from this stream. * @param src the stream to connect to. * @param pipeSize the size of the pipe's buffer. ! * @throws IOException if an I/O error occurs. ! * @throws IllegalArgumentException if {@code pipeSize <= 0}. * @since 1.6 */ public PipedReader(PipedWriter src, int pipeSize) throws IOException { initPipe(pipeSize); connect(src);
*** 118,128 **** * It must be {@linkplain java.io.PipedWriter#connect( * java.io.PipedReader) connected} to a <code>PipedWriter</code> * before being used. * * @param pipeSize the size of the pipe's buffer. ! * @exception IllegalArgumentException if {@code pipeSize <= 0}. * @since 1.6 */ public PipedReader(int pipeSize) { initPipe(pipeSize); } --- 118,128 ---- * It must be {@linkplain java.io.PipedWriter#connect( * java.io.PipedReader) connected} to a <code>PipedWriter</code> * before being used. * * @param pipeSize the size of the pipe's buffer. ! * @throws IllegalArgumentException if {@code pipeSize <= 0}. * @since 1.6 */ public PipedReader(int pipeSize) { initPipe(pipeSize); }
*** 153,163 **** * <pre><code>src.connect(snk)</code> </pre> * <p> * The two calls have the same effect. * * @param src The piped writer to connect to. ! * @exception IOException if an I/O error occurs. */ public void connect(PipedWriter src) throws IOException { src.connect(this); } --- 153,163 ---- * <pre><code>src.connect(snk)</code> </pre> * <p> * The two calls have the same effect. * * @param src The piped writer to connect to. ! * @throws IOException if an I/O error occurs. */ public void connect(PipedWriter src) throws IOException { src.connect(this); }
*** 223,233 **** * This method blocks until input data is available, the end of * the stream is detected, or an exception is thrown. * * @return the next character of data, or <code>-1</code> if the end of the * stream is reached. ! * @exception IOException if the pipe is * <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>, * {@link #connect(java.io.PipedWriter) unconnected}, closed, * or an I/O error occurs. */ public synchronized int read() throws IOException { --- 223,233 ---- * This method blocks until input data is available, the end of * the stream is detected, or an exception is thrown. * * @return the next character of data, or <code>-1</code> if the end of the * stream is reached. ! * @throws IOException if the pipe is * <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>, * {@link #connect(java.io.PipedWriter) unconnected}, closed, * or an I/O error occurs. */ public synchronized int read() throws IOException {
*** 280,294 **** * @param off the start offset of the data. * @param len the maximum number of characters read. * @return the total number of characters read into the buffer, or * <code>-1</code> if there is no more data because the end of * the stream has been reached. ! * @exception IOException if the pipe is * <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>, * {@link #connect(java.io.PipedWriter) unconnected}, closed, * or an I/O error occurs. ! * @exception IndexOutOfBoundsException {@inheritDoc} */ public synchronized int read(char cbuf[], int off, int len) throws IOException { if (!connected) { throw new IOException("Pipe not connected"); } else if (closedByReader) { --- 280,294 ---- * @param off the start offset of the data. * @param len the maximum number of characters read. * @return the total number of characters read into the buffer, or * <code>-1</code> if there is no more data because the end of * the stream has been reached. ! * @throws IOException if the pipe is * <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>, * {@link #connect(java.io.PipedWriter) unconnected}, closed, * or an I/O error occurs. ! * @throws IndexOutOfBoundsException {@inheritDoc} */ public synchronized int read(char cbuf[], int off, int len) throws IOException { if (!connected) { throw new IOException("Pipe not connected"); } else if (closedByReader) {
*** 328,338 **** /** * Tell whether this stream is ready to be read. A piped character * stream is ready if the circular buffer is not empty. * ! * @exception IOException if the pipe is * <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>, * {@link #connect(java.io.PipedWriter) unconnected}, or closed. */ public synchronized boolean ready() throws IOException { if (!connected) { --- 328,338 ---- /** * Tell whether this stream is ready to be read. A piped character * stream is ready if the circular buffer is not empty. * ! * @throws IOException if the pipe is * <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>, * {@link #connect(java.io.PipedWriter) unconnected}, or closed. */ public synchronized boolean ready() throws IOException { if (!connected) {
*** 352,362 **** /** * Closes this piped stream and releases any system resources * associated with the stream. * ! * @exception IOException if an I/O error occurs. */ public void close() throws IOException { in = -1; closedByReader = true; } --- 352,362 ---- /** * Closes this piped stream and releases any system resources * associated with the stream. * ! * @throws IOException if an I/O error occurs. */ public void close() throws IOException { in = -1; closedByReader = true; }
< prev index next >