This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori 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