This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: Patch for PR 7528


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]