iTextSharp.text.pdf.RandomAccessFileOrArray.ReadShort C# (CSharp) Метод

ReadShort() публичный Метод

public ReadShort ( ) : short
Результат short
        public short ReadShort()
        {
            int ch1 = this.Read();
            int ch2 = this.Read();
            if ((ch1 | ch2) < 0)
                throw new EndOfStreamException();
            return (short)((ch1 << 8) + ch2);
        }

Usage Example

Пример #1
0
        protected void CheckGlyphComposite(int glyph)
        {
            int start = locaTable[glyph];

            if (start == locaTable[glyph + 1]) // no contour
            {
                return;
            }
            rf.Seek(tableGlyphOffset + start);
            int numContours = rf.ReadShort();

            if (numContours >= 0)
            {
                return;
            }
            rf.SkipBytes(8);
            for (;;)
            {
                int flags  = rf.ReadUnsignedShort();
                int cGlyph = rf.ReadUnsignedShort();
                if (!glyphsUsed.ContainsKey(cGlyph))
                {
                    glyphsUsed[cGlyph] = null;
                    glyphsInList.Add(cGlyph);
                }
                if ((flags & MORE_COMPONENTS) == 0)
                {
                    return;
                }
                int skip;
                if ((flags & ARG_1_AND_2_ARE_WORDS) != 0)
                {
                    skip = 4;
                }
                else
                {
                    skip = 2;
                }
                if ((flags & WE_HAVE_A_SCALE) != 0)
                {
                    skip += 2;
                }
                else if ((flags & WE_HAVE_AN_X_AND_Y_SCALE) != 0)
                {
                    skip += 4;
                }
                if ((flags & WE_HAVE_A_TWO_BY_TWO) != 0)
                {
                    skip += 8;
                }
                rf.SkipBytes(skip);
            }
        }
All Usage Examples Of iTextSharp.text.pdf.RandomAccessFileOrArray::ReadShort