public int getBits(int size) { // readBits
		int byteOff = bitOffset >> 3;
		int bitOff = MAX_BIT_LEN - (bitOffset & 7);
		int dest = 0;
		bitOffset += size;
		for (; size > bitOff; bitOff = MAX_BIT_LEN) {
			dest += (payload[byteOff++] & Stream.bitMask[bitOff]) << size - bitOff;
			size -= bitOff;
		}
		if (size == bitOff) {
			dest += payload[byteOff] & Stream.bitMask[bitOff];
		} else {
			dest += payload[byteOff] >> bitOff - size & Stream.bitMask[size];
		}
		return dest;
	}