It can, and it is. All data in your computer is already being used directly as binary. I built my GA library on this principle.
Code:
int myInt = 15;
println(binary(myInt));
byte myBin = (byte)unbinary("1000");
println(myBin);
So long as your int or byte is an arbitrary variable you can stop thinking of it as an int or byte and start treating it like a binary.
The following page has an excellent range of methods for performing tasks in binary.
http://graphics.stanford.edu/~seander/bithacks.html
Most useful is discovering the log base 2 of a binary. That's basically the position of the highest bit set, or how many digits that are in your binary number. The following function is from the above page and is far faster than using Processing's float based methods to get the same answer.
Code:
final int [] MultiplyDeBruijnBitPosition = {
0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4,8,
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
};
static final int bitLog(int num){
num |= num >> 1; // first round down to power of 2
num |= num >> 2;
num |= num >> 4;
num |= num >> 8;
num |= num >> 16;
num = (num >> 1) + 1;
return MultiplyDeBruijnBitPosition[(num * 0x077CB531) >> 27];
}