playing with bits
well, for the first time ever I have to get down to bits using java.
I see where all the &, |, ^ etc. come into it, but I can't find much more on it. I'd like to know how I could say, oh I don't know, assign the first and third bits of an octet to the value of 1.
I then need to be able to get these values out.
Or is there an easy way to take e.g. 00000010 and convert it into 2?
can anybody point me in the direction of a relevant Java tutorial or briefly explain it to me?
cheers all.
I see where all the &, |, ^ etc. come into it, but I can't find much more on it. I'd like to know how I could say, oh I don't know, assign the first and third bits of an octet to the value of 1.
I then need to be able to get these values out.
Or is there an easy way to take e.g. 00000010 and convert it into 2?
can anybody point me in the direction of a relevant Java tutorial or briefly explain it to me?
cheers all.
