import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; public class MainClass { public byte[] readRecord(int rn) throws IOException { RandomAccessFile ranf = new RandomAccessFile("c:\\a.txt","w"); long fpos = rn * 3; ranf.seek(fpos); byte[] rec = new byte[3]; ranf.read(rec); return rec; } }