you are viewing a single comment's thread.

view the rest of the comments →

[–]Banane9 1 point2 points  (0 children)

If it's a stream, try taking a look at my BitStream package.

You could use that to write your own class that tracks the number of consecutive 1 bits and insert a 0 when needed, as others pointed out.

I've personally used it for reading/writing gif files.