283 |
* |
* |
284 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
285 |
*/ |
*/ |
286 |
public synchronized long skip(long numBytes) throws IOException |
public synchronized long skip (long numBytes) throws IOException |
287 |
{ |
{ |
288 |
if (numBytes < 0) |
if (numBytes < 0) |
289 |
throw new IllegalArgumentException("Can't skip negative bytes: " + |
throw new IllegalArgumentException ("Can't skip negative bytes: " + |
290 |
numBytes); |
numBytes); |
291 |
|
|
292 |
if (numBytes == 0) |
if (numBytes == 0) |
293 |
return(0); |
return 0; |
294 |
|
|
295 |
long curPos = fd.getFilePointer(); |
long curPos = fd.getFilePointer (); |
296 |
long newPos = fd.seek(numBytes, FileDescriptor.CUR, true); |
long newPos = fd.seek (numBytes, FileDescriptor.CUR, true); |
297 |
return newPos - curPos; |
return newPos - curPos; |
298 |
} |
} |
299 |
|
|