示例#1
0
        private void readXrefTable()
        {
            int  prevCount, count, offset, generation;
            bool succes;

            for (; ;)
            {
                _lexer.ReadLexeme();
                if (_lexer.CurrentLexemeEquals("trailer"))
                {
                    break;
                }

                prevCount = _lexer.CurrentLexemeToInteger(out succes);
                if (!succes || prevCount < 0)
                {
                    return;
                }

                count = _lexer.ReadInteger(out succes);
                if (!succes || count < 0)
                {
                    return;
                }

                addEntries(prevCount + count);
                for (int i = 0; i < count; ++i)
                {
                    offset = _lexer.ReadInteger(out succes);
                    if (!succes)
                    {
                        return;
                    }

                    generation = _lexer.ReadInteger(out succes);
                    if (!succes)
                    {
                        return;
                    }

                    _lexer.ReadLexeme();
                    if (_xref.Entries[prevCount + i] == null)
                    {
                        _xref.Entries[prevCount + i] = new Entry(offset, generation);
                    }
                }
            }
        }