diff options
author | Michael Koch <konqueror@gmx.de> | 2003-03-20 07:54:24 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-03-20 07:54:24 +0000 |
commit | 10b33028a2a620bc2864fc8f939072599762a1e2 (patch) | |
tree | c99af8765e9410ed162e184496445f198dee0afc /libjava/java/io/FileInputStream.java | |
parent | 04b3370bfd9d028ee9f048ca76bc25bbd2a86c88 (diff) | |
download | gcc-10b33028a2a620bc2864fc8f939072599762a1e2.zip gcc-10b33028a2a620bc2864fc8f939072599762a1e2.tar.gz gcc-10b33028a2a620bc2864fc8f939072599762a1e2.tar.bz2 |
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.
From-SVN: r64609
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 bbc7f7c..dcda9d8 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; + } } } |