code: static final int get6Bit(final Memory mem, final int offsetBytes, final int slotNo) {
      final int startBit = slotNo * 6;
      final int shift = startBit & 0X7;
      final int byteIdx = (startBit >>> 3) + offsetBytes;
      return (byte) ((mem.getShort(byteIdx) >>> shift) & 0X3F);
    }
docs: works for both heap and direct