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:
parent
c9407e4c67
commit
39f90b7ce0
5 changed files with 120 additions and 29 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue