Пример #1
0
        override public void AfterTextHeaderSet()
        {
            var textAtom = this.TextHeaderAtom.TextAtom;

            /* This can legitimately happen... */
            if (textAtom == null)
            {
                this.Reader.BaseStream.Position = this.Reader.BaseStream.Length;
                return;
            }

            uint seenLength = 0;

            while (seenLength < textAtom.Text.Length + 1)
            {
                long pos    = this.Reader.BaseStream.Position;
                uint length = this.Reader.ReadUInt32();

                var run = new ParagraphRun(this.Reader, false);
                run.Length = length;
                this.PRuns.Add(run);

                /*TraceLogger.DebugInternal("Read paragraph run. Before pos = {0}, after pos = {1} of {2}: {3}",
                 *  pos, this.Reader.BaseStream.Position, this.Reader.BaseStream.Length,
                 *  run);*/

                seenLength += length;
            }

            //TraceLogger.DebugInternal();

            seenLength = 0;
            while (seenLength < textAtom.Text.Length + 1)
            {
                uint length = this.Reader.ReadUInt32();

                var run = new CharacterRun(this.Reader);
                run.Length = length;
                this.CRuns.Add(run);

                seenLength += length;
            }

            this.VerifyReadToEnd();
        }
Пример #2
0
 public TextPFExceptionAtom(BinaryReader _reader, uint size, uint typeCode, uint version, uint instance)
     : base(_reader, size, typeCode, version, instance)
 {
     this.Reader.ReadInt16();
     this.run = new ParagraphRun(this.Reader, true);
 }