Originally posted by Nitin Gupte:
Is there any method any where in Java APIs which i can use to skip the specified lines from reading?
No. Files are just bytes. Line termination characters are particular bytes that we've agreed mean something special. There's no way to distinguish line terminators from other bytes without reading all of the bytes in.
You could, if you
really needed this kind of functionality, make a file with fixed-length records, each record being a line padded to the maximum length. Then you could find a particular line by multiplying the record length by the line number. This, of course, comes with its own set of problems, like what the max line length is, how do you enforce it, how to insert and delete lines and so on.