diff options
| author | Tom Tromey <tromey@gcc.gnu.org> | 2007-01-09 19:58:05 +0000 |
|---|---|---|
| committer | Tom Tromey <tromey@gcc.gnu.org> | 2007-01-09 19:58:05 +0000 |
| commit | 97b8365cafc3a344a22d3980b8ed885f5c6d8357 (patch) | |
| tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath/java/io/RandomAccessFile.java | |
| parent | c648dedbde727ca3f883bb5fd773aa4af70d3369 (diff) | |
Merged gcj-eclipse branch to trunk.
From-SVN: r120621
Diffstat (limited to 'libjava/classpath/java/io/RandomAccessFile.java')
| -rw-r--r-- | libjava/classpath/java/io/RandomAccessFile.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/libjava/classpath/java/io/RandomAccessFile.java b/libjava/classpath/java/io/RandomAccessFile.java index 84ee5dec01e..036fc8c6bda 100644 --- a/libjava/classpath/java/io/RandomAccessFile.java +++ b/libjava/classpath/java/io/RandomAccessFile.java @@ -38,7 +38,7 @@ exception statement from your version. */ package java.io; -import gnu.java.nio.channels.FileChannelImpl; +import gnu.java.nio.FileChannelImpl; import java.nio.channels.FileChannel; @@ -58,7 +58,7 @@ import java.nio.channels.FileChannel; * @author Aaron M. Renn (arenn@urbanophile.com) * @author Tom Tromey (tromey@cygnus.com) */ -public class RandomAccessFile implements DataOutput, DataInput +public class RandomAccessFile implements DataOutput, DataInput, Closeable { // The underlying file. @@ -122,7 +122,20 @@ public class RandomAccessFile implements DataOutput, DataInput s.checkWrite(fileName); } - ch = FileChannelImpl.create(file, fdmode); + try + { + ch = FileChannelImpl.create(file, fdmode); + } + catch (FileNotFoundException fnfe) + { + throw fnfe; + } + catch (IOException ioe) + { + FileNotFoundException fnfe = new FileNotFoundException(file.getPath()); + fnfe.initCause(ioe); + throw fnfe; + } fd = new FileDescriptor(ch); if ((fdmode & FileChannelImpl.WRITE) != 0) out = new DataOutputStream (new FileOutputStream (fd)); |
