Exemple #1
0
        public bool PeekBool()
        {
            ThrowIfOverflow(1);

            ulong dummy = m_Cursor;

            return(BitReader.ReadUIntBits(m_Data, ref dummy, 1) == 1);
        }
Exemple #2
0
        public uint ReadUInt(byte bits = 32)
        {
            if (bits < 1 || bits > 32)
            {
                throw new ArgumentOutOfRangeException(nameof(bits));
            }

            ThrowIfOverflow(bits);

            return((uint)BitReader.ReadUIntBits(m_Data, ref m_Cursor, bits));
        }
Exemple #3
0
        public byte ReadByte(byte bits = 8)
        {
            if (bits < 1 || bits > 8)
            {
                throw new ArgumentOutOfRangeException(nameof(bits));
            }

            ThrowIfOverflow(bits);

            return((byte)BitReader.ReadUIntBits(m_Data, ref m_Cursor, bits));
        }
Exemple #4
0
        public ulong ReadULong(byte bits = 64)
        {
            if (bits < 1 || bits > 64)
            {
                throw new ArgumentOutOfRangeException(nameof(bits));
            }

            ThrowIfOverflow(bits);

            return(BitReader.ReadUIntBits(m_Data, ref m_Cursor, bits));
        }
Exemple #5
0
        public bool ReadBool()
        {
            ThrowIfOverflow(1);

            return(BitReader.ReadUIntBits(m_Data, ref m_Cursor, 1) == 1);
        }