Here you can find the source of getRandomAccessFile()
public static RandomAccessFile getRandomAccessFile() throws FileNotFoundException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileNotFoundException; import java.io.RandomAccessFile; public class Main { private static final String db_name = "TestInterceptDB.data"; private static RandomAccessFile randomAccessFile = null; public static RandomAccessFile getRandomAccessFile() throws FileNotFoundException { if (randomAccessFile == null) { try { randomAccessFile = new RandomAccessFile(new File(db_name), "rw"); } catch (FileNotFoundException e) { throw new FileNotFoundException(e.getMessage()); }/*from w w w . j ava 2 s.c om*/ } return randomAccessFile; } }