And what about the buffer?
When do they clear/flush the buffer, as writing the data to the output file?
Or how do they handle it anyways?
raw_offset = (tail - 18 - real_offset) & 0xFFFF
Is this formula right (i think it should be "& 0x0FFF, does it?) ?
I'll try it on weekend.
EDIT: I recognized you forgot something in your calculation, it's
REAL_OFF =
tail - (tail - 18 - raw_offset) & 0x0FFF
Does this change anything about the final formula?
EDIT: Come on, can noone help me here?
I just need the formula to calculate the index to write in the compressed file, when i have the index of the data to refer to in the uncompressed input file.
I couldnt get it to work properly with your way, Cyberman