how can I store a sequence of bits in an array of bytes[] ? in more detail: I have an array
byte[] bytes;
how will I store individual values (0s and 1s) in a single byte of the array? I am looking for something like:
bit[] bits = new bit[8];
bits[0] = 1;
bits[3] = 1;
bytes[3] = bits[];
I hope that makes sense. thanks
Stringand useByte.parseBytewith a radix of 2?String. In which case, there's no real cost in memory (at least in Java 6; Java 7 manages memory differently for strings).