Originally posted by Dave Brown:
Hi All, Hopefully one of you can help me, I think i've got to the stage where i've been staring at the code too long to miss an obvious problem..
I want to read in a binary file, look for all occurances of hex 0x00 and change those bytes to hex 0xFF.
My problem is, the resulting file is 'always' large than the original file.. It appears the last buffered read, is being written twice and I dont understand why.. my code is as follows..
Thanks in advance..
Hi
How about take in one byte at a time (byte[] buffer = new byte[1]
, compare read character with the old character, perform the change if there is a match. After your program ran, you may be able to see what's going on.
good luck.