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


C# BufferedBinaryReader.ReadBoolean方法代码示例

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


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

示例1: ReadData

        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="flags">Flags.</param>
        public void ReadData(BufferedBinaryReader binaryReader, byte flags)
        {
            base.SetStartPoint(binaryReader);
            byte numBits = (byte)(flags & 0x0F);
            bool generalLineFLag = binaryReader.ReadBoolean();
            deltaX = 0;
            deltaY = 0;

            if (generalLineFLag)
            {
                deltaX = binaryReader.ReadSBits((uint)(numBits + 2));
                deltaY = binaryReader.ReadSBits((uint)(numBits + 2));
            }
            else
            {
                bool vertLineFlag = binaryReader.ReadBoolean();
                if (!vertLineFlag)
                    deltaX = binaryReader.ReadSBits((uint)(numBits + 2));
                else
                    deltaY = binaryReader.ReadSBits((uint)(numBits + 2));
            }
            base.SetEndPoint(binaryReader);
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:28,代码来源:ShapeRecord.cs

示例2: ReadData

 /// <summary>
 /// Reads the data.
 /// </summary>
 /// <param name="binaryReader">Binary reader.</param>
 public void ReadData(BufferedBinaryReader binaryReader)
 {
     base.SetStartPoint(binaryReader);
     binaryReader.SynchBits();
     bool hasScale = binaryReader.ReadBoolean();
     if (hasScale)
     {
         uint nScaleBits = binaryReader.ReadUBits(5);
         matrix[0, 0] = binaryReader.ReadFloat(nScaleBits);
         matrix[1, 1] = binaryReader.ReadFloat(nScaleBits);
     }
     bool hasRotate = binaryReader.ReadBoolean();
     if (hasRotate)
     {
         uint nRotateBits = binaryReader.ReadUBits(5);
         matrix[1, 0] = binaryReader.ReadFloat(nRotateBits);
         matrix[0, 1] = binaryReader.ReadFloat(nRotateBits);
     }
     uint nTranslateBits = binaryReader.ReadUBits(5);
     matrix[0, 2] = (float)binaryReader.ReadSBits(nTranslateBits);
     matrix[1, 2] = (float)binaryReader.ReadSBits(nTranslateBits);
     binaryReader.SynchBits();
     base.SetEndPoint(binaryReader);
 }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:28,代码来源:Matrix.cs

示例3: 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);

            long startPosition = binaryReader.BaseStream.Position;

            buttonId = binaryReader.ReadUInt16();
            binaryReader.ReadUBits(7); //reserved
            trackAsMenu = binaryReader.ReadBoolean();

            long startPos = binaryReader.BaseStream.Position;

            actionOffset = binaryReader.ReadUInt16();

            if (characters == null)
                characters = new ButtonRecordCollection();
            else
                characters.Clear();

            bool characterEndFlag = false;
            while (!characterEndFlag)
            {
                byte first = binaryReader.ReadByte();
                if (first == 0)
                    characterEndFlag = true;
                else
                {
                    ButtonRecord buttRecord = new ButtonRecord();
                    buttRecord.ReadData(binaryReader, first, TagCodeEnum.DefineButton2);
                    characters.Add(buttRecord);
                }
            }

            long curr = startPos + actionOffset;

            actions = new ButtonCondactionCollection();
            bool lastCondAction = false;
            if (actionOffset == 0)
                lastCondAction = true;

            while (!lastCondAction)
            {
                long readedBytes = binaryReader.BaseStream.Position - startPosition;
                ushort condActionSize = binaryReader.ReadUInt16();
                if (condActionSize == 0)
                {
                    lastCondAction = true;
                    condActionSize = (ushort)(rh.TagLength - readedBytes);
                }
                ButtonCondaction buttCond = new ButtonCondaction();
                buttCond.ReadData(binaryReader, condActionSize);
                actions.Add(buttCond);
            }
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:58,代码来源:DefineButton2Tag.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);

            characterId = binaryReader.ReadUInt16();
            numFrames = binaryReader.ReadUInt16();
            width = binaryReader.ReadUInt16();
            height = binaryReader.ReadUInt16();
            binaryReader.ReadUBits(5);
            videoFlagsDeblocking = binaryReader.ReadUBits(2);
            videoFlagsSmoothing = binaryReader.ReadBoolean();
            codecId = binaryReader.ReadByte();
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:17,代码来源:DefineVideoStreamTag.cs

示例5: ReadData

        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="shapeType">Shape type.</param>
        public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType)
        {
            binaryReader.SynchBits();
            byte numFillBits = (byte)binaryReader.ReadUBits(4);
            byte numLineBits = (byte)binaryReader.ReadUBits(4);

            bool readEndShapeRecord = false;
            while (!readEndShapeRecord)
            {
                bool type = binaryReader.ReadBoolean();
                byte flags = (byte)binaryReader.ReadUBits(5);

                if (type == false)
                {
                    //Non-edge record
                    if (flags == 0)
                    {
                        //EndShapeRecord
                        readEndShapeRecord = true;
                        this.Add(new EndShapeRecord());
                        if (log.IsInfoEnabled)
                            log.Info("Shape: EndShapeRecord");
                    }
                    else
                    {
                        //StyleChangerecord
                        StyleChangeRecord styleChange = new StyleChangeRecord();
                        styleChange.ReadData(binaryReader, flags, ref numFillBits, ref numLineBits, shapeType);
                        this.Add(styleChange);
                        if (log.IsInfoEnabled)
                            log.Info("Shape: StyleChangeRecord");
                    }
                }
                else
                {
                    //Edge record
                    if ((flags & 0x10) != 0)
                    {
                        //StraightedEdgeRecord
                        StraightEdgeRecord straight = new StraightEdgeRecord();
                        straight.ReadData(binaryReader, flags);
                        this.Add(straight);
                        if (log.IsInfoEnabled)
                            log.Info("Shape: StraightedEdgeRecord");
                    }
                    else
                    {
                        //CurvedEdgeRecord
                        CurvedEdgeRecord curved = new CurvedEdgeRecord();
                        curved.ReadData(binaryReader, flags);
                        this.Add(curved);
                        if (log.IsInfoEnabled)
                            log.Info("Shape: CurvedEdgeRecord");
                    }
                }
            }
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:62,代码来源:ShapeRecordCollection.cs

示例6: 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();
            byte fontNameLen = binaryReader.ReadByte();
            fontName = binaryReader.ReadString(fontNameLen);

            binaryReader.ReadUBits(2); //reserved
            fontFlagsSmallText = binaryReader.ReadBoolean();
            binaryReader.ReadUBits(2); //not used
            fontFlagsItalic = binaryReader.ReadBoolean();
            fontFlagsBold = binaryReader.ReadBoolean();
            binaryReader.ReadBoolean(); //not used

            languageCode = binaryReader.ReadByte();

            long codeTableLenght = rh.TagLength - 5 - fontNameLen;
            codeTable = null;
            codeTable = new ushort[codeTableLenght];
            for (int i = 0; i < codeTableLenght / 2; i++)
                codeTable[i] = binaryReader.ReadUInt16();
        }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:27,代码来源:DefineFontInfo2Tag.cs

示例7: 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

示例8: 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();
            byte fontNameLen = binaryReader.ReadByte();
            fontName = binaryReader.ReadString(fontNameLen);

            binaryReader.ReadUBits(2); //reserved
            fontFlagsSmallText = binaryReader.ReadBoolean();
            fontFlagsShiftJIS = binaryReader.ReadBoolean();
            fontFlagsAINSI = binaryReader.ReadBoolean();
            fontFlagsItalic = binaryReader.ReadBoolean();
            fontFlagsBold = binaryReader.ReadBoolean();
            fontFlagsWildCodes = binaryReader.ReadBoolean();

            uint codeTableLenght = rh.TagLength - 4 - fontNameLen;

            if (!fontFlagsWildCodes)
            {
                codeTable = new uint[codeTableLenght];
                for (int i = 0; i < codeTableLenght; i++)
                    codeTable[i] = (uint)binaryReader.ReadByte();
            }
            else
            {
                codeTable = new uint[codeTableLenght / 2];
                for (int i = 0; i < codeTableLenght / 2; i++)
                    codeTable[i] = (uint)binaryReader.ReadUInt16();
            }
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:35,代码来源:DefineFontInfoTag.cs

示例9: ReadData

        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="version">Version.</param>
        /// <param name="binaryReader">Binary reader.</param>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            base.ReadData(version, binaryReader);
            this.soundFormat = (FlvSoundFormat)binaryReader.ReadUBits(4);
            this.soundRate = binaryReader.ReadUBits(2);
            this.isSnd16Bits = binaryReader.ReadBoolean();
            this.isStereo = binaryReader.ReadBoolean();

            uint dataLenght = this.dataSize - 1;
            if (dataLenght > 0)
            {
                this.soundData = new byte[dataLenght];
                for (int i = 0; i < dataLenght; i++)
                    this.soundData[i] = binaryReader.ReadByte();
            }
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:21,代码来源:FlvAudioTag.cs

示例10: 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

示例11: ReadData

        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        public void ReadData(BufferedBinaryReader binaryReader)
        {
            hasAddTerms = binaryReader.ReadBoolean();
            hasMultTerms = binaryReader.ReadBoolean();
            uint nBits = binaryReader.ReadUBits(4);

            if (hasMultTerms)
            {
                int redMultTerms = binaryReader.ReadSBits(nBits);
                int greenMultTerms = binaryReader.ReadSBits(nBits);
                int blueMultTerms = binaryReader.ReadSBits(nBits);
            }

            if (hasAddTerms)
            {
                int redAddTerms = binaryReader.ReadSBits(nBits);
                int greenAddTerms = binaryReader.ReadSBits(nBits);
                int blueAddTerms = binaryReader.ReadSBits(nBits);
            }
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:24,代码来源:CXForm.cs

示例12: ReadData

        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        public void ReadData(BufferedBinaryReader binaryReader)
        {
            bool hasAddTerms = binaryReader.ReadBoolean();
            bool hasMultTerms = binaryReader.ReadBoolean();
            uint nBits = binaryReader.ReadUBits(4);

            if (hasMultTerms)
            {
                redMultTerms = binaryReader.ReadSBits(nBits);
                greenMultTerms = binaryReader.ReadSBits(nBits);
                blueMultTerms = binaryReader.ReadSBits(nBits);
                alphaMultTerms = binaryReader.ReadSBits(nBits);
            }

            if (hasAddTerms)
            {
                redAddTerms = binaryReader.ReadSBits(nBits);
                greenAddTerms = binaryReader.ReadSBits(nBits);
                blueAddTerms = binaryReader.ReadSBits(nBits);
                alphaAddTerms = binaryReader.ReadSBits(nBits);
            }
        }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:26,代码来源:CXFormWithAlphaData.cs

示例13: ReadData

 /// <summary>
 /// Reads the data from a binary reader.
 /// </summary>
 /// <param name="binaryReader">Binary reader.</param>
 public void ReadData(BufferedBinaryReader binaryReader)
 {
     binaryReader.ReadBoolean();
     this.red = (byte)binaryReader.ReadUBits(5);
     this.green = (byte)binaryReader.ReadUBits(5);
     this.blue = (byte)binaryReader.ReadUBits(5);
 }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:11,代码来源:Pix.cs

示例14: ReadData

 /// <summary>
 /// Reads the data.
 /// </summary>
 /// <param name="reader">Reader.</param>
 public void ReadData(BufferedBinaryReader reader)
 {
     this.signature = reader.ReadString(3);
     this.version = reader.ReadByte();
     reader.ReadUBits(5);
     this.hasAudio = reader.ReadBoolean();
     reader.ReadBoolean();
     this.hasVideo = reader.ReadBoolean();
     reader.ReadUInt32();
 }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:14,代码来源:FlvHeader.cs

示例15: ReadData

        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        public void ReadData(BufferedBinaryReader binaryReader)
        {
            binaryReader.ReadUBits(2);

            syncStop = binaryReader.ReadBoolean();
            syncNoMultiple = binaryReader.ReadBoolean();
            bool hasEnvelope = binaryReader.ReadBoolean();
            bool hasLoops = binaryReader.ReadBoolean();
            bool hasOutPoint = binaryReader.ReadBoolean();
            bool hasInPoint = binaryReader.ReadBoolean();

            if (hasInPoint)
                inPoint = binaryReader.ReadUInt32();
            if (hasOutPoint)
                outPoint = binaryReader.ReadUInt32();
            if (hasLoops)
                loopCount = binaryReader.ReadUInt16();
            if (hasEnvelope)
            {
                byte envPoints = binaryReader.ReadByte();
                if (envPoints != 0)
                {
                    envelopeRecord.Clear();
                    for (int i = 0; i < envPoints; i++)
                    {
                        SoundEnvelope envelope = new SoundEnvelope();
                        envelope.ReadData(binaryReader);
                        envelopeRecord.Add(envelope);
                    }
                }
            }
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:36,代码来源:Sound.cs


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