}
the method chunkFile() is responsible for reading a file (might be having 10,0000 records) and based on the interval (as passed in the method argument; lets say 10,000) it creates new files each having 10,000 records.

Ramya,
The chunkFile method is called only once in its life cycle...so i dont think this an issue.
The issue is thisLine1(as it is holding lets say 10,000 records in it; where the actual file is 1,00000 and interval is 10,000) is using a lot of memory which is making the process too slow.
Do we have any API in java file system where i could read a file from one line to the other desired line; so that i could skip the thisLine1 code...

"Do we have any API in java file system where i could read a file from one line to the other desired line; so that i could skip the thisLine1 code... "

let me explain..

lets say i have a file of 1,000 lines. coz of some performance issues in reading the file line by line, i want some mechanism where i could read the file lets say from line 1 to line 100 then line101 to line200...and so on.I dont wanna read the 1st 1-100 lines line by line, instead i want some mechanism where i will specify the fromLineNumber to toLineNumber and the contents in between that would be read at once..

That's what happens when you try to append a StringBuilder to itself; don't do that but think first before you attempt to code. The StringBuilder must be used to collect (append) the new content, there is no need to append the already present content.