PipedWriter.java (flush): Throw exception if stream closed.

* java/io/PipedWriter.java (flush): Throw exception if stream
	closed.
	* java/io/OutputStreamWriter.java (write): Throw exception if
	stream closed.
	(writeChars): Don't throw exception if stream closed.
	* java/io/CharArrayWriter.java (closed): New field.
	(close): Set it.
	(flush): Throw exception if stream closed.
	(reset): Synchronize on correct lock.  Allow stream to be
	reopened.
	(toCharArray, toString, writeTo): Synchronize.
	(write): Throwe exception if stream closed.
	* java/io/BufferedWriter.java (close): Clear `buffer'.
	(flush): Throw IOException if stream is closed.
	(write): Likewise.

From-SVN: r39927
This commit is contained in:
Tom Tromey 2001-02-20 19:01:55 +00:00 committed by Tom Tromey
parent c9407e4c67
commit 39f90b7ce0
5 changed files with 120 additions and 29 deletions

View file

@ -142,8 +142,10 @@ public class PipedWriter extends Writer
* had read all available data. Thats not the case - this method
* appears to be a no-op?
*/
public void flush()
public void flush() throws IOException
{
if (closed)
throw new IOException ("Pipe closed");
}
/**