Esempio n. 1
0
 public BitStream(Stream stream, BitStreamType type, bool isLittleEdian, bool isMsb2Lsb)
 {
     _br = new BinaryReader(stream);
     _type = type;
     _isLittleEdian = isLittleEdian;
     _isMsb2Lsb = isMsb2Lsb;
     switch (type)
     {
         case BitStreamType.EightBits:
             _valueBits = 8;
             break;
         case BitStreamType.SixteenBits:
             _valueBits = 16;
             break;
         case BitStreamType.ThirtyTwoBits:
             _valueBits = 32;
             break;
         default:
             throw new ArgumentOutOfRangeException(nameof(type));
     }
 }
Esempio n. 2
0
        public BitStream(Stream stream, BitStreamType type, bool isLittleEdian, bool isMsb2Lsb)
        {
            _br            = new BinaryReader(stream);
            _type          = type;
            _isLittleEdian = isLittleEdian;
            _isMsb2Lsb     = isMsb2Lsb;
            switch (type)
            {
            case BitStreamType.EightBits:
                _valueBits = 8;
                break;

            case BitStreamType.SixteenBits:
                _valueBits = 16;
                break;

            case BitStreamType.ThirtyTwoBits:
                _valueBits = 32;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type));
            }
        }