ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.WriteBits C# (CSharp) Method

WriteBits() public method

Write bits to internal buffer
public WriteBits ( int b, int count ) : void
b int source of bits
count int number of bits to write
return void
        public void WriteBits(int b, int count)
        {
            #if DebugDeflation
            if (DeflaterConstants.DEBUGGING && (start != 0) )
            {
                throw new SharpZipBaseException("Debug check: start != 0");
            }

            //			if (DeflaterConstants.DEBUGGING) {
            //				//Console.WriteLine("writeBits("+b+","+count+")");
            //			}
            #endif
            bits |= (uint)(b << bitCount);
            bitCount += count;
            if (bitCount >= 16) {
                buffer_[end++] = unchecked((byte)bits);
                buffer_[end++] = unchecked((byte)(bits >> 8));
                bits >>= 16;
                bitCount -= 16;
            }
        }