This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
You can either try using a RandomAccessFile or (using the methods Jeevi suggested) you can read the file in and write the entire contents plus the changes out to a temporary file and then delete the old file and rename the new one.
Note that RandomAccessFile will only work if the number of bytes you are replacing is exactly the same as the number of bytes you want to overwrite them with. If the numbers differ, the file will be garbage.
Raj Kumar Bindal
Joined: Apr 15, 2006
Yes i Agree..RandomAccessFile seems not to be the good choice
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com