diff options
author | Michael Koch <konqueror@gmx.de> | 2003-03-25 12:20:49 +0000 |
---|---|---|
committer | Michael Koch <konqueror@gmx.de> | 2003-03-25 12:20:49 +0000 |
commit | 03b71a228bed9e02a00bc3864f13293990fbf08a (patch) | |
tree | 9ec175cfeb1464e4c1e950ea9d39be4eb6604b29 /java/io/FileOutputStream.java | |
parent | 5ab69b305aad1ac7b5feaa1498493b0f8796d2dc (diff) | |
download | classpath-03b71a228bed9e02a00bc3864f13293990fbf08a.tar.gz |
2003-03-25 Michael Koch <konqueror@gmx.de>
* java/io/FileOutputStream.java
(getFD): Check FileDescriptor object before using it, Reformatted.
(write): Reformatted.
(close): Check FileDescriptor object before using it.
Diffstat (limited to 'java/io/FileOutputStream.java')
-rw-r--r-- | java/io/FileOutputStream.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/java/io/FileOutputStream.java b/java/io/FileOutputStream.java index 409397f7f..175b48edf 100644 --- a/java/io/FileOutputStream.java +++ b/java/io/FileOutputStream.java @@ -38,7 +38,6 @@ exception statement from your version. */ package java.io; -import gnu.classpath.Configuration; import java.nio.channels.FileChannel; import gnu.java.nio.FileChannelImpl; @@ -207,8 +206,10 @@ public class FileOutputStream extends OutputStream * * @exception IOException If an error occurs */ - public final FileDescriptor getFD() throws IOException + public final FileDescriptor getFD () throws IOException { + if (! fd.valid()) + throw new IOException (); return fd; } @@ -219,7 +220,7 @@ public class FileOutputStream extends OutputStream * * @exception IOException If an error occurs */ - public void write(int b) throws IOException + public void write (int b) throws IOException { fd.write (b); } @@ -261,7 +262,8 @@ public class FileOutputStream extends OutputStream */ public void close () throws IOException { - fd.close (); + if (fd.valid()) + fd.close(); } /** |