src/share/classes/java/io/RandomAccessFile.java
Print this page
*** 516,526 ****
* beginning of the file, at which to set the file
* pointer.
* @exception IOException if {@code pos} is less than
* {@code 0} or if an I/O error occurs.
*/
! public native void seek(long pos) throws IOException;
/**
* Returns the length of this file.
*
* @return the length of this file, measured in bytes.
--- 516,534 ----
* beginning of the file, at which to set the file
* pointer.
* @exception IOException if {@code pos} is less than
* {@code 0} or if an I/O error occurs.
*/
! public void seek(long pos) throws IOException {
! if (pos < 0) {
! throw new IOException("Negative seek offset");
! } else {
! seek0(pos);
! }
! }
!
! private native void seek0(long pos) throws IOException;
/**
* Returns the length of this file.
*
* @return the length of this file, measured in bytes.