How to read bit by bit in a file
My question is that
assume that you have a file with hundred's of 0's or 1's (binary)
example:
10010101010101101
10101010101010111
.......
Now I want to read one bit at a time from that file. Is that possible?
If there was a space " " in between each bits then Yes I could do it by
Code:
long long int dataDECODER[512];
int j = 0;
ifstream inBINARY;
inBINARY.open("outBinaryFile.txt");
while(!inBINARY.eof())
{
inBINARY >> dataFILE[j];
j++;
}
I cannot grab the whole data into an array (if there were to be no spaces in between) or a variable because the value in the file is too large.
What I am trying to do is reading each bit and use "Tree Branch" method for the Huffman.
So is there a way to do this?