toBinaryString in Java removes leading 0...help?
Well, the reason I need it is because i have to XOR two values in my 8 bit binary string. Say my program says I XOR bit 1 and bit 8 of every 8 bit binary string. In my above case, I'd be XOR'ing 0 and 1, to get 1. However, since the leading 0 is being discarded, my program would XOR 1 and nothing, and then error out.
I think I figured it out though, by just inputting the binary value into a character array and adding leading 0's for however many characters I was short of 8 bits.
On a mission to be the first to drink 500 unique beers at World of Beer UCF. Check out my progress and read tons of reviews at www.beeruken.com
Progress: 500/500 as of 10/18/12
Completed the 500 beer challenge!!!