diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 91f2cb4c3a7..8c4208b7cfd 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2002-08-13 Jesse Rosenstock + + * java/io/RandomAccessFile.java (skipBytes): Return number of + bytes skipped. + 2002-08-01 Mark Wielaard Reenable patch since shared library troubles on powerpc are solved: diff --git a/libjava/java/io/RandomAccessFile.java b/libjava/java/io/RandomAccessFile.java index 81b7050f62d..1d30f1f3772 100644 --- a/libjava/java/io/RandomAccessFile.java +++ b/libjava/java/io/RandomAccessFile.java @@ -171,7 +171,11 @@ public class RandomAccessFile implements DataOutput, DataInput public int skipBytes (int count) throws IOException { - return count <= 0 ? 0 : fd.seek(count, FileDescriptor.CUR, true); + if (count <= 0) + return 0; + long startPos = fd.getFilePointer(); + long endPos = fd.seek(count, FileDescriptor.CUR, true); + return (int) (endPos - startPos); } public void write (int oneByte) throws IOException