FSO.Files.Formats.IFF.Chunks.TTABFieldEncode.ReadBit C# (CSharp) Method

ReadBit() private method

private ReadBit ( ) : byte
return byte
        private byte ReadBit()
        {
            byte result = (byte)((curByte & (1 << (7 - bitPos))) >> (7 - bitPos));
            if (++bitPos > 7)
            {
                bitPos = 0;
                try
                {
                    curByte = io.ReadByte();
                }
                catch (Exception)
                {
                    curByte = 0; //no more data, read 0
                }
            }
            return result;
        }