Siva Kannan wrote:When I try to use BufferedReader/BufferedWriter it loads the file into the memory (I believe)
No it doesn't. It stores a little portion, but definitely not the entire file. Are you sure it's not you that stores the entire file? You shouldn't, as you will only need a few (usually one) lines at a time.
Wouter: RandomAccessFile can be used for binary files, but for text files it's not really good (ASCII files can be handled but I wouldn't go any further).