diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-20 07:54:24 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-20 07:54:24 +0000 |
commit | ff0263c808951d22e7f0324fd28877cf4f6a1fab (patch) | |
tree | c99af8765e9410ed162e184496445f198dee0afc /libjava/java/io/FileInputStream.java | |
parent | 2653f9df5503bdf69f827ea82909a623484605a3 (diff) | |
download | gcc-ff0263c808951d22e7f0324fd28877cf4f6a1fab.tar.gz |
2003-03-20 Michael Koch <konqueror@gmx.de>
* java/io/FileInputStream.java
(getChannel): New implementation.
* java/io/FileOutputStream.java
(ch): New member variable.
(getChannel): Implemented.
* java/io/RandomAccessFile.java
(RandomAccessFile): Throws FileNotFoundException instead of
IOException.
(getChannel): New method.
(ch): New member variable.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64609 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/io/FileInputStream.java')
-rw-r--r-- | libjava/java/io/FileInputStream.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libjava/java/io/FileInputStream.java b/libjava/java/io/FileInputStream.java index bbc7f7c6840..dcda9d81e64 100644 --- a/libjava/java/io/FileInputStream.java +++ b/libjava/java/io/FileInputStream.java @@ -34,6 +34,7 @@ exception statement from your version. */ package java.io; import java.nio.channels.FileChannel; +import gnu.java.nio.FileChannelImpl; /** * @author Warren Levy <warrenl@cygnus.com> @@ -124,6 +125,12 @@ public class FileInputStream extends InputStream public FileChannel getChannel () { - return ch; + synchronized (this) + { + if (ch == null) + ch = new FileChannelImpl (fd, false, this); + + return ch; + } } } |