Dae galera!! Eu to fazendo uns testes usando a classe RandoAccessFile a me ocorreram algumas dúvidas:
Eu tenho um for assim:
for( int i = 0; i < file.length(); i++ ) {
buffer.putChar( ( char ) file.read());
if( buffer.getChar().indexOf("Jhonatas"))
file.seek( file.getFilePointer());
}