FromReader() public static method

public static FromReader ( MethodBody methodBody, IBinaryStreamReader reader, bool fatFormat ) : ExceptionHandler
methodBody MethodBody
reader IBinaryStreamReader
fatFormat bool
return ExceptionHandler
Ejemplo n.º 1
0
        private IEnumerable <ExceptionHandler> ReadExceptionHandlers()
        {
            var  reader = _sectionReadingContext.Reader;
            byte sectionHeader;

            do
            {
                sectionHeader = reader.ReadByte();
                if ((sectionHeader & 0x01) == 0x01)
                {
                    var isFat        = (sectionHeader & 0x40) == 0x40;
                    var handlerCount = 0;
                    if (isFat)
                    {
                        handlerCount = ((reader.ReadByte() |
                                         (reader.ReadByte() << 0x08) |
                                         reader.ReadByte() << 0x10) / 24);
                    }
                    else
                    {
                        handlerCount = reader.ReadByte() / 12;
                        reader.ReadUInt16();
                    }

                    for (int i = 0; i < handlerCount; i++)
                    {
                        yield return(ExceptionHandler.FromReader(this, reader, isFat));
                    }
                }
            } while ((sectionHeader & 0x80) == 0x80);
        }