LynnaLab.StreamValueReference.GetIntValue C# (CSharp) Method

GetIntValue() public method

public GetIntValue ( ) : int
return int
        public override int GetIntValue()
        {
            stream.Seek(valueIndex, SeekOrigin.Begin);
            switch(ValueType) {
                case DataValueType.ByteBits:
                    {
                        int andValue = (1<<(endBit-startBit+1))-1;
                        return (stream.ReadByte()>>startBit)&andValue;
                    }
                case DataValueType.ByteBit:
                    return (stream.ReadByte()>>startBit)&1;
                case DataValueType.Word:
                    {
                        int w = stream.ReadByte();
                        w |= stream.ReadByte() << 8;
                        return w;
                    }
                default:
                    return stream.ReadByte();
            }
        }