-
January 11th, 2011, 02:43 PM
#1
[RESOLVED] Changing portion of a file
I have a file where I need to append a checksum to the beginning. How would this be done? I don't think it's possible to insert data, so I can allocate space by writing 512 0s, but how would I overwrite them later?
-
January 12th, 2011, 05:46 AM
#2
Re: Changing portion of a file
You can use java.io.RandomAccessFile or if the file is short it may be easier to rename the existing file, create a new file with the old filename and then write the data to append followed by the data in the renamed file. Finally you can delete the renamed file or if it's renamed to *.bak keep it as a previous version of the file.
-
January 12th, 2011, 09:53 PM
#3
Re: Changing portion of a file
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|