System.IO.Compression.InputBuffer.TryLoad16Bits C# (CSharp) Méthode

TryLoad16Bits() public méthode

public TryLoad16Bits ( ) : uint
Résultat uint
        public uint TryLoad16Bits() {
            if (this.bitsInBuffer < 8) {
                if (this.start < this.end) {
                    this.bitBuffer |= (uint)(this.buffer[this.start++] << this.bitsInBuffer);
                    this.bitsInBuffer += 8;
                }
                if (this.start < this.end) {
                    this.bitBuffer |= (uint)(this.buffer[this.start++] << this.bitsInBuffer);
                    this.bitsInBuffer += 8;
                }
            }
            else if ((this.bitsInBuffer < 0x10) && (this.start < this.end)) {
                this.bitBuffer |= (uint)(this.buffer[this.start++] << this.bitsInBuffer);
                this.bitsInBuffer += 8;
            }
            return this.bitBuffer;
        }

Usage Example

Exemple #1
0
        public int GetNextSymbol(InputBuffer input)
        {
            uint num = input.TryLoad16Bits();

            if (input.AvailableBits == 0)
            {
                return(-1);
            }
            int index = this.table[(num & this.tableMask)];

            if (index < 0)
            {
                uint num3 = ((uint)1) << this.tableBits;
                do
                {
                    index = -index;
                    if ((num & num3) == 0)
                    {
                        index = this.left[index];
                    }
                    else
                    {
                        index = this.right[index];
                    }
                    num3 = num3 << 1;
                }while (index < 0);
            }
            if (this.codeLengthArray[index] > input.AvailableBits)
            {
                return(-1);
            }
            input.SkipBits(this.codeLengthArray[index]);
            return(index);
        }
All Usage Examples Of System.IO.Compression.InputBuffer::TryLoad16Bits