当前位置: 首页>>代码示例>>C#>>正文


C# BufferedBinaryReader.ReadInt16方法代码示例

本文整理汇总了C#中SwfDotNet.IO.Utils.BufferedBinaryReader.ReadInt16方法的典型用法代码示例。如果您正苦于以下问题:C# BufferedBinaryReader.ReadInt16方法的具体用法?C# BufferedBinaryReader.ReadInt16怎么用?C# BufferedBinaryReader.ReadInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SwfDotNet.IO.Utils.BufferedBinaryReader的用法示例。


在下文中一共展示了BufferedBinaryReader.ReadInt16方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadData

 /// <summary>
 /// Reads the data.
 /// </summary>
 /// <param name="binaryReader">Binary reader.</param>
 /// <param name="fontFlagsWideCodes">Font flags wide codes.</param>
 public void ReadData(BufferedBinaryReader binaryReader, bool fontFlagsWideCodes)
 {
     this.fontFlagsWideCodes = fontFlagsWideCodes;
     if (fontFlagsWideCodes)
     {
         fontFlagsWideCode1 = (uint)binaryReader.ReadUInt16();
         fontFlagsWideCode2 = (uint)binaryReader.ReadUInt16();
     }
     else
     {
         fontFlagsWideCode1 = (uint)binaryReader.ReadByte();
         fontFlagsWideCode2 = (uint)binaryReader.ReadByte();
     }
     short fontKerningAdjustement = binaryReader.ReadInt16();
 }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:20,代码来源:KerningRecord.cs

示例2: ReadData

        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="endOfRecordsFlag">End of records flag.</param>
        /// <param name="tagCodeEnum">Tag code enum.</param>
        public void ReadData(BufferedBinaryReader binaryReader, ref bool endOfRecordsFlag, 
            TagCodeEnum tagCodeEnum)
        {
            binaryReader.SynchBits();
            bool textRecordType = binaryReader.ReadBoolean();
            binaryReader.ReadUBits(3);

            bool styleFlagsHasFont = binaryReader.ReadBoolean();
            bool styleFlagsHasColor = binaryReader.ReadBoolean();
            bool styleFlagsHasYOffset = binaryReader.ReadBoolean();
            bool styleFlagsHasXOffset = binaryReader.ReadBoolean();

            if (textRecordType == false)
            {
                endOfRecordsFlag = true;
                return;
            }

            fontId = 0;
            if (styleFlagsHasFont)
                fontId = binaryReader.ReadUInt16();

            textColor = null;
            if (styleFlagsHasColor)
            {
                if (tagCodeEnum == TagCodeEnum.DefineText2)
                {
                    textColor = new RGBA();
                    textColor.ReadData(binaryReader);
                }
                else
                {
                    textColor = new RGB();
                    textColor.ReadData(binaryReader);
                }
            }

            xOffset = 0;
            if (styleFlagsHasXOffset)
                xOffset = binaryReader.ReadInt16();

            yOffset = 0;
            if (styleFlagsHasYOffset)
                yOffset = binaryReader.ReadInt16();

            textHeight = 0;
            if (styleFlagsHasFont)
                textHeight = binaryReader.ReadUInt16();

            byte glyphCount = binaryReader.ReadByte();
            if (glyphCount > 0)
            {
                if (glyphEntries == null)
                    glyphEntries = new GlyphEntryCollection();
                else
                    glyphEntries.Clear();

                for (int i = 0; i < glyphCount; i++)
                {
                    GlyphEntry glyphEntry = new GlyphEntry();
                    glyphEntry.ReadData(binaryReader);
                    glyphEntries.Add(glyphEntry);
                }
            }
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:71,代码来源:TextRecord.cs

示例3: ReadData

 /// <summary>
 /// Reads the data.
 /// </summary>
 /// <param name="binaryReader">Binary reader.</param>
 /// <param name="numGlyphs">Num glyphs.</param>
 public void ReadData(BufferedBinaryReader binaryReader, ushort numGlyphs)
 {
     for (int i = 0; i < numGlyphs; i++)
         this.Add(binaryReader.ReadInt16());
 }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:10,代码来源:ShortCollection.cs

示例4: ReadData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            RecordHeader rh = new RecordHeader();
            rh.ReadData(binaryReader);

            binaryReader.ReadUBits(4);
            playbackSoundRate = binaryReader.ReadUBits(2);
            playbackSoundSize = binaryReader.ReadUBits(1);
            playbackSoundType = binaryReader.ReadUBits(1);
            streamSoundCompression = binaryReader.ReadUBits(4);
            streamSoundRate = binaryReader.ReadUBits(2);
            streamSoundSize = binaryReader.ReadUBits(1);
            streamSoundType = binaryReader.ReadUBits(1);

            streamSoundSampleCount = binaryReader.ReadUInt16();
            latencySeek = 0;

            if (streamSoundCompression == 2)
                latencySeek = binaryReader.ReadInt16();
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:23,代码来源:SoundStreamHeadTag.cs

示例5: ReadData

        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            RecordHeader rh = new RecordHeader();
            rh.ReadData(binaryReader);

            fontId = binaryReader.ReadUInt16();

            bool fontFlagsHasLayout = binaryReader.ReadBoolean();
            fontFlagsShiftJIS = binaryReader.ReadBoolean();
            fontFlagsSmallText = binaryReader.ReadBoolean();
            fontFlagsANSI = binaryReader.ReadBoolean();
            bool fontFlagsWideOffsets = binaryReader.ReadBoolean();
            bool fontFlagsWideCodes = binaryReader.ReadBoolean();
            fontFlagsItalic = binaryReader.ReadBoolean();
            fontFlagsBold = binaryReader.ReadBoolean();
            languageCode = (LanguageCode)binaryReader.ReadByte();
            byte fontNameLength = binaryReader.ReadByte();

            fontName = binaryReader.ReadString(fontNameLength);

            ushort numGlyphs = binaryReader.ReadUInt16();

            if (numGlyphs > 0)
            {
                uint[] offsetTable = new uint[numGlyphs];
                for (int i = 0; i < numGlyphs; i++)
                {
                    if (fontFlagsWideOffsets)
                        offsetTable[i] = binaryReader.ReadUInt32();
                    else
                        offsetTable[i] = (uint)binaryReader.ReadUInt16();
                }
            }
            uint codeTableOffset = 0;
            if (fontFlagsWideOffsets)
                codeTableOffset = binaryReader.ReadUInt32();
            else
                codeTableOffset = (uint)binaryReader.ReadUInt16();

            if (numGlyphs > 0)
            {
                this.glyphShapesTable.IsWideCodes = fontFlagsWideCodes;
                this.glyphShapesTable.ReadData(binaryReader, numGlyphs);
            }

            if (fontFlagsHasLayout)
            {
                fontAscent = binaryReader.ReadInt16();
                fontDescent = binaryReader.ReadInt16();
                fontLeading = binaryReader.ReadInt16();

                if (numGlyphs > 0)
                {
                    fontAdvanceTable.ReadData(binaryReader, numGlyphs);
                    fontBoundsTable.ReadData(binaryReader, numGlyphs);
                    fontKerningTable.ReadData(binaryReader, fontFlagsWideCodes);
                }
            }
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:62,代码来源:DefineFont2Tag.cs


注:本文中的SwfDotNet.IO.Utils.BufferedBinaryReader.ReadInt16方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。