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:
@@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user