Convert byte to it's bit representation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I get the bits that compose a byte?

Say I pass a byte of value 10 to my byteToBitArray function, I would
LIKE to get back an array (8 long) of 00001010.

I want that back cause that's the binary representation of the byte 10.

Any idea how to do this?
 
A BitArray holds an array of bits represented by Booleans (true / false, 1 or
0)
So your method can manipulate the bits in the array to construct whatever it
is that you need back (such as a string of 1's and 0's).
Peter
 
Back
Top