// packing a (4 bit field) and b (2 bit field) into c (a 16-bit short) // slide a to left to make room for b and plop a to the left of b short c = (short) ((a << 2) | b);