byte merge (II)
Hi,
Following from an earlier post, I wish to merge bytes b1 & b2:
b1 = 1 (0000 0001)
b2 = 7 (0000 0111)
and when I merge them, I need the result: 0000 0001 0000 0111 (263). I got a reply to apply 256 * XOR operator on byte number and add the results. I did that and got the value 1:
byte b1 = 1;
byte b2 = 7;
b1 = (byte) (b1 * (256^1));
b2 = (byte) (b2 * (256^0));
System.out.println("b's = " + (b2 + b1));
can the author enlighten me on what I doing worng, or someone suggest an algorithm to do this should-be easy merge?
thanks

