mirror of
https://github.com/openRuyi-Project/gcc.git
synced 2026-06-16 00:16:04 +00:00
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:
committed by
Bryce McKinlay
parent
e89268b691
commit
acf9549ef9
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user