in reply to Re^13: pack/unpack binary editing
in thread pack/unpack binary editing

Sorry, the company would frown upon that. I think my problem is that I'm reading in the equivalent of 2 frames but have to discard so many bits to get to the sync. afterwhich I no longer have a frame left that's on a byte boundary. This is why I am currently writting the ascii-ized binary out to a file then reopening and going though the file to pack it back. I forgot I had changed that part of the code.

Replies are listed 'Best First'.
Re^15: pack/unpack binary editing
by BrowserUk (Patriarch) on Feb 10, 2005 at 19:00 UTC

    If you are only discarding from the first (double) record, then if the original file is sync'd, the resultant file will be:

    Read |------------|------------|------------|------------|---| --------------------------------------------------------- ....|s 7680 bits |s 7680 bits |s 7680 bits |s 7680 bits | --------------------------------------------------------- write <<<<|s-------|----s-------|----s-------|----s-------|---| |s-------|----s-------|----s-------|----s-------|---| ----------------------------------------------------- |s 7680 bits |s 7680 bits |s 7680 bits |s 7680 bits | -----------------------------------------------------

    Anyway, good luck.


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.
      Thanks for your help. I think I may open the first frame and prepend 0's until the sync is on a byte boundary and then work with everything as hex. Thanks again.