C
Chris
What's the most efficient way to pack two bytes into a char? This is the
best I could come up with, but it looks terrible:
byte b0 = 0;
byte b1 = 1;
char ch = (char)(((int)b0 << 8) | b1);
This appears to have two explicit casts and one implicit one. It's also
really slow.
best I could come up with, but it looks terrible:
byte b0 = 0;
byte b1 = 1;
char ch = (char)(((int)b0 << 8) | b1);
This appears to have two explicit casts and one implicit one. It's also
really slow.