Append mode info. On success, store the result in "bits".
static void appendModeInfo(Mode mode, BitArray bits) { bits.appendBits(mode.bits, 4); }