BKSystem.IO.BitStream.Or C# (CSharp) Метод

Or() публичный Метод

Performs a bitwise OR operation on the bits in the current stream against the corresponding bits in the specified stream.
.
/// The current stream is closed. /// /// bits is a null reference (Nothing in Visual Basic). /// /// The stream specified by the bits parameter and the current /// stream do not have the same number of bits. ///
public Or ( BitStream bits ) : BitStream
bits BitStream /// A object with which to perform the bitwise /// OR operation. ///
Результат BitStream
        public virtual BitStream Or(BitStream bits)
        {
            if(!_blnIsOpen)
                throw new ObjectDisposedException(BitStreamResources.GetString("ObjectDisposed_BitStreamClosed"));
            if(bits == null)
                throw new ArgumentNullException("bits", BitStreamResources.GetString("ArgumentNull_BitStream"));
            if(bits.Length != _uiBitBuffer_Length)
                throw new ArgumentException(BitStreamResources.GetString("Argument_DifferentBitStreamLengths"));

            // Create the new BitStream
            BitStream bstrmNew = new BitStream(_uiBitBuffer_Length);

            uint uiWholeUInt32Lengths = _uiBitBuffer_Length >> BitBuffer_SizeOfElement_Shift;
            uint uiCounter = 0;

            for(uiCounter = 0; uiCounter < uiWholeUInt32Lengths; uiCounter++)
                bstrmNew._auiBitBuffer[uiCounter] = _auiBitBuffer[uiCounter] | bits._auiBitBuffer[uiCounter];

            // Are there any further bits in the buffer?
            if((_uiBitBuffer_Length & BitBuffer_SizeOfElement_Mod) > 0)
            {
                uint uiBitMask = uint.MaxValue << (int)(BitBuffer_SizeOfElement - (_uiBitBuffer_Length & BitBuffer_SizeOfElement_Mod));
                bstrmNew._auiBitBuffer[uiCounter] = _auiBitBuffer[uiCounter] | bits._auiBitBuffer[uiCounter] & uiBitMask;
            }

            return bstrmNew;
        }