2003-04-06 Michael Koch <konqueror@gmx.de>
* java/io/FileInputStream.java (skip): Renamed some variables to match classpath, added checks from classpath. From-SVN: r65300
This commit is contained in:
parent
10b7602f3f
commit
af5fcbd02e
2 changed files with 17 additions and 4 deletions
|
@ -268,11 +268,18 @@ public class FileInputStream extends InputStream
|
|||
*
|
||||
* @exception IOException If an error occurs
|
||||
*/
|
||||
public long skip(long n) throws IOException
|
||||
public long skip (long numBytes) throws IOException
|
||||
{
|
||||
long startPos = fd.getFilePointer();
|
||||
long endPos = fd.seek(n, FileDescriptor.CUR, true);
|
||||
return endPos - startPos;
|
||||
if (numBytes < 0)
|
||||
throw new IllegalArgumentException ( "Can't skip negative bytes: " +
|
||||
numBytes);
|
||||
|
||||
if (numBytes == 0)
|
||||
return 0;
|
||||
|
||||
long curPos = fd.getFilePointer ();
|
||||
long newPos = fd.seek (numBytes, FileDescriptor.CUR, true);
|
||||
return newPos - curPos;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue