FileInputStream.java (skip): Call fd.getFilePointer() and calculate correct number of bytes skipped.

* java/io/FileInputStream.java (skip): Call fd.getFilePointer() and
	calculate correct number of bytes skipped.

From-SVN: r51293
This commit is contained in:
Bryce McKinlay 2002-03-25 02:01:29 +00:00 committed by Bryce McKinlay
parent e89268b691
commit acf9549ef9
2 changed files with 6 additions and 1 deletions

View file

@ -88,6 +88,8 @@ public class FileInputStream extends InputStream
public long skip(long n) throws IOException
{
return n <= 0 ? 0 : fd.seek(n, FileDescriptor.CUR, true);
long startPos = fd.getFilePointer();
long endPos = fd.seek(n, FileDescriptor.CUR, true);
return endPos - startPos;
}
}