I'm not quite sure how easy it is to fetch the binary composition of a file, but suppose we have some file with this representation:
010011
We could make 2 arrays.
One which stores the position of the 0s: ['x', '', 'x', 'x', '', '']
And another which stores the position of the 1s (which is simply the opposite of the previous array): ['', 'x', '', '', 'x', 'x']
Then we can persist these two arrays into a file, and voila?
I don't know, is there something i'm not realizing?
I'm not an expert in compression, was just wondering if this would work.