Here you can find the source of getRandomAccessFile(String path, String charEncoding)
public static RandomAccessFile getRandomAccessFile(String path, String charEncoding) throws FileNotFoundException
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { public static RandomAccessFile getRandomAccessFile(String path, String charEncoding) throws FileNotFoundException { InputStream is = getInputStream(path); if (is != null) { return new RandomAccessFile(new File(path), "r"); }//from w ww . j av a 2 s. c o m return null; } public static InputStream getInputStream(String path) { try { return new FileInputStream(path); } catch (FileNotFoundException e) { e.printStackTrace(); } return null; } }