summaryrefslogtreecommitdiffstats
path: root/libjava/java/io/RandomAccessFile.java
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-02 23:46:39 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-02 23:46:39 +0000
commitb981695a68c06694a48068337ed21f5ac380c9f2 (patch)
tree9a4a339f33e52b784286ab24c2d8b29c0c4f6d69 /libjava/java/io/RandomAccessFile.java
parent815df046cd0c9377ab9848eec1ff73e9d52e7674 (diff)
downloadppe42-gcc-b981695a68c06694a48068337ed21f5ac380c9f2.tar.gz
ppe42-gcc-b981695a68c06694a48068337ed21f5ac380c9f2.zip
* java/io/RandomAccessFile.java (seek): Let seek go past end of
file. (skipBytes): Don't fail if seeking past end of file. * java/io/FileInputStream.java (skip): Don't fail if seeking past end of file. * java/io/natFileDescriptorWin32.cc (seek): Handle `eof_trunc' argument. * java/io/natFileDescriptorEcos.cc (seek): Handle `eof_trunc' argument. * java/io/natFileDescriptorPosix.cc (seek): Handle `eof_trunc' argument. * java/io/FileDescriptor.java (seek): Added `eof_trunc' argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44586 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/io/RandomAccessFile.java')
-rw-r--r--libjava/java/io/RandomAccessFile.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/libjava/java/io/RandomAccessFile.java b/libjava/java/io/RandomAccessFile.java
index 9a0bf807202..418974c091e 100644
--- a/libjava/java/io/RandomAccessFile.java
+++ b/libjava/java/io/RandomAccessFile.java
@@ -1,6 +1,6 @@
// RandomAccessFile.java
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation
This file is part of libgcj.
@@ -161,12 +161,12 @@ public class RandomAccessFile implements DataOutput, DataInput
public void seek (long pos) throws IOException
{
- fd.seek(pos, FileDescriptor.SET);
+ fd.seek(pos, FileDescriptor.SET, false);
}
public int skipBytes (int count) throws IOException
{
- return fd.seek(count, FileDescriptor.CUR);
+ return count <= 0 ? 0 : fd.seek(count, FileDescriptor.CUR, true);
}
public void write (int oneByte) throws IOException
OpenPOWER on IntegriCloud