Convert byte to it's bit representation

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?
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top