If I create a random byte[]
, for instance:
byte[] b = new byte[16];
new Random().nextBytes(b);
That means that I have 16 bytes or 128 bits of data, right?
Is there a way to read the bit in position X so that I can learn if it's 0 or 1?
This question is similar, but not the same as, an existing question that asks how to get a bit in a byte. But I want a bit in a byte array, byte[]
.