예제 #1
0
        /// <summary>Append a different BitVector to this BitVector</summary>
        /// <param name="bits">BitVector to append</param>
        public void AppendBitVector(iText.Barcodes.Qrcode.BitVector bits)
        {
            int size = bits.Size();

            for (int i = 0; i < size; ++i)
            {
                AppendBit(bits.At(i));
            }
        }
예제 #2
0
        /// <summary>XOR the contents of this bitvector with the contetns of "other"</summary>
        /// <param name="other">Bitvector of equal length</param>
        public void Xor(iText.Barcodes.Qrcode.BitVector other)
        {
            if (sizeInBits != other.Size())
            {
                throw new ArgumentException("BitVector sizes don't match");
            }
            int sizeInBytes = (sizeInBits + 7) >> 3;

            for (int i = 0; i < sizeInBytes; ++i)
            {
                // The last byte could be incomplete (i.e. not have 8 bits in
                // it) but there is no problem since 0 XOR 0 == 0.
                array[i] ^= other.array[i];
            }
        }