From: Jesse Rosenstock Date: Tue, 13 Aug 2002 23:10:11 +0000 (+0000) Subject: RandomAccessFile.java (skipBytes): Return number of bytes skipped. X-Git-Tag: releases/gcc-3.3.0~3303 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03496eb1211829070ac92d915ee6fe65de69bb98;p=thirdparty%2Fgcc.git RandomAccessFile.java (skipBytes): Return number of bytes skipped. 2002-08-13 Jesse Rosenstock * java/io/RandomAccessFile.java (skipBytes): Return number of bytes skipped. From-SVN: r56265 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 91f2cb4c3a7f..8c4208b7cfd4 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 81b7050f62dd..1d30f1f37728 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