diff options
author | Ronald Veldema <rveldema@cs.vu.nl> | 2002-04-08 10:14:49 +0000 |
---|---|---|
committer | Ronald Veldema <rveldema@cs.vu.nl> | 2002-04-08 10:14:49 +0000 |
commit | 1f38683012be387218081bf51cda77aac708058d (patch) | |
tree | 96bee8cf5c70d306f244a99dcd705b4dd5754fe6 /java/io/FileOutputStream.java | |
parent | d5bc926813c38e6dac3d39f3fb1c7cee67760125 (diff) | |
download | classpath-1f38683012be387218081bf51cda77aac708058d.tar.gz |
- basic nio apps now work
- removed old Accessible, now use new javax.Accessibility
Diffstat (limited to 'java/io/FileOutputStream.java')
-rw-r--r-- | java/io/FileOutputStream.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/java/io/FileOutputStream.java b/java/io/FileOutputStream.java index 349c14376..28fb21d73 100644 --- a/java/io/FileOutputStream.java +++ b/java/io/FileOutputStream.java @@ -39,6 +39,8 @@ exception statement from your version. */ package java.io; import gnu.classpath.Configuration; +import java.nio.channels.FileChannel; +import gnu.java.nio.FileChannelImpl; /** * This classes allows a stream of data to be written to a disk file or @@ -353,5 +355,29 @@ finalize() throws IOException close(); } +/*************************************************************************/ + +/** + * This method creates a java.nio.channels.FileChannel. + * Nio does not allow one to create a file channel directly. + * A file channel must be created by first creating an instance of + * Input/Output/RandomAccessFile and invoking the getChannel() method on it. + */ + +private FileChannel ch; /* cached associated file-channel */ + +public FileChannel +getChannel() +{ + synchronized (this) + { + if (ch == null) + ch = new gnu.java.nio.FileChannelImpl(native_fd, + this); + } + return ch; +} + + } // class FileOutputStream |