public void seek ( long pos ) throws IOException { if ( pos < 0 ) throw new java . io . IOException ( "Negative seek offset" ) ; // If the seek is into the buffer, just update the file pointer. if ( ( pos >= bufferStart ) && ( pos < dataEnd ) ) { filePosition = pos ; return ; } // need new buffer, starting at pos readBuffer ( pos ) ; }
Set the position in the file for the next read or write .