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:
parent
e89268b691
commit
acf9549ef9
2 changed files with 6 additions and 1 deletions
|
@ -2,6 +2,9 @@
|
|||
|
||||
* java/io/PushbackReader.java: Reformat.
|
||||
|
||||
* java/io/FileInputStream.java (skip): Call fd.getFilePointer() and
|
||||
calculate correct number of bytes skipped.
|
||||
|
||||
2002-03-24 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* java/awt/TextComponent.java (TextComponent): Editable by
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue