Ejemplo n.º 1
0
 private float UnpackFloatNoScale(Bitstream stream)
 {
     var data = stream.ReadManyBits(32);
     return BitConverter.ToSingle(data, 0);
 }
Ejemplo n.º 2
0
        private byte[] ReadValueIfIncluded(Bitstream stream, bool userDataFixedSize,
            uint userDataSizeBits)
        {
            var has_value = stream.ReadBool();

            if (!has_value)
            {
                return null;
            }

            uint length;
            uint bitLength;

            if (userDataFixedSize)
            {
                length = (userDataSizeBits + 7)/8;
                bitLength = userDataSizeBits;
            }
            else
            {
                length = stream.ReadBits(14);
                bitLength = 8*length;
            }

            return stream.ReadManyBits(bitLength);
        }