This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: Patch for PR 7528
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 13 Aug 2002 17:12:29 -0600
- Subject: Patch: FYI: Patch for PR 7528
- Reply-to: tromey at redhat dot com
I'm checking this in. This fixes PR 7528, and comes from the PR.
I've also turned the test in the PR into a Mauve test case and checked
it in.
Tom
* java/io/RandomAccessFile.java (skipBytes): Return number of
bytes skipped.
Index: java/io/RandomAccessFile.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/RandomAccessFile.java,v
retrieving revision 1.7
diff -u -r1.7 RandomAccessFile.java
--- java/io/RandomAccessFile.java 24 Jul 2002 17:48:41 -0000 1.7
+++ java/io/RandomAccessFile.java 13 Aug 2002 23:08:37 -0000
@@ -171,7 +171,11 @@
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