This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
OutputStreamWriter IOException
- To: java-patches at gcc dot gnu dot org
- Subject: OutputStreamWriter IOException
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Fri, 09 Feb 2001 17:07:29 +1300
I'm checking in a parallel fix to PR 1913, for OutputStreamWriter.
regards
[ bryce ]
2001-02-08 Bryce McKinlay <bryce@albatross.co.nz>
* java/io/OutputStreamWriter.java: (flush, writeChars): Throw
IOException if stream closed.
Index: OutputStreamWriter.java
===================================================================
RCS file: /cvs/gcc/egcs/libjava/java/io/OutputStreamWriter.java,v
retrieving revision 1.8
diff -u -r1.8 OutputStreamWriter.java
--- OutputStreamWriter.java 2000/07/28 02:54:16 1.8
+++ OutputStreamWriter.java 2001/02/09 03:56:42
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -69,6 +69,9 @@
{
synchronized (lock)
{
+ if (out == null)
+ throw new IOException("Stream closed");
+
if (wcount > 0)
{
writeChars(work, 0, wcount);
@@ -97,6 +100,9 @@
private void writeChars(char[] buf, int offset, int count)
throws IOException
{
+ if (out == null)
+ throw new IOException("Stream closed");
+
while (count > 0)
{
// We must flush if out.count == out.buf.length.