Patch: FYI: Patch for PR 7528

Tom Tromey tromey@redhat.com
Tue Aug 13 16:09:00 GMT 2002


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



More information about the Java-patches mailing list