I have a file say which has 5000 characters.
I am reading the first 1000 characters and closing my file. I want to delete these first 1000 characters from the file. How can I do that?

Rewrite the remaining 4000 in a new file, delete the old file, and rename the new file to the old file's name.

actually 5000 char was just an example. My file size is more than 200 MB. So I guess rewriting will waste alot of time.
So I wanted to delete the characters from my original file itself.

No, since you can't "just delete the first whatever". Maybe with some other language would allow you to manipulate the file system in such a way as to move the pointer designating the file to another position on the file system, but Java (and most other languages) do not, generally, give such control.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.