• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Utils.BufferedBinaryReader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



BufferedBinaryReader类属于SwfDotNet.IO.Utils命名空间,在下文中一共展示了BufferedBinaryReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

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

            int tl = System.Convert.ToInt32(rh.TagLength);
            Meta = binaryReader.ReadString();
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:11,代码来源:MetadataTag.cs


示例2: ReadData

        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        public override void ReadData(BufferedBinaryReader binaryReader)
        {
            uint pictureStartCode = binaryReader.ReadUBits(17);
            uint version = binaryReader.ReadUBits(5);
            uint temporalRef = binaryReader.ReadUBits(8);

            //TODO...
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:12,代码来源:VideoPacket.cs


示例3: ReadData

        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            base.ReadData(version, binaryReader);

            Type = (FlvScriptType)binaryReader.ReadUBits(8);

            int count = 0;
            if (Type == FlvScriptType.Number)
                count = 8;

            for (int i = 0; i < count; i++)
            {
                binaryReader.ReadByte();
            }
        }
开发者ID:wuzhen,项目名称:SwfDecompiler,代码行数:15,代码来源:FlvScriptTag.cs


示例4: ReadData

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

            startColor = null;
            endColor = null;
            if (fillStyleType == (byte)MorphFillStyleType.SolidFill)
            {
                startColor = new RGBA();
                startColor.ReadData(binaryReader);
                endColor = new RGBA();
                endColor.ReadData(binaryReader);
            }

            startGradientMatrix = null;
            endGradientMatrix = null;
            MorphGradientCollection gradient = null;
            if (fillStyleType == (byte)MorphFillStyleType.LinearGradientFill ||
                fillStyleType == (byte)MorphFillStyleType.RadialGradientFill)
            {
                startGradientMatrix = new Matrix();
                startGradientMatrix.ReadData(binaryReader);
                endGradientMatrix = new Matrix();
                endGradientMatrix.ReadData(binaryReader);
                gradient = new MorphGradientCollection();
                gradient.ReadData(binaryReader);
            }

            bitmapId = 0;
            startBitmapMatrix = null;
            endBitmapMatrix = null;
            if (fillStyleType == (byte)MorphFillStyleType.RepeatingBitmap ||
                fillStyleType == (byte)MorphFillStyleType.ClippedBitmapFill ||
                fillStyleType == (byte)MorphFillStyleType.NonSmoothedClippedBitmap ||
                fillStyleType == (byte)MorphFillStyleType.NonSmoothedRepeatingBitmap)
            {
                bitmapId = binaryReader.ReadUInt16();
                startBitmapMatrix = new Matrix();
                startBitmapMatrix.ReadData(binaryReader);
                endBitmapMatrix = new Matrix();
                endBitmapMatrix.ReadData(binaryReader);
            }
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:47,代码来源:MorphFillStyle.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)
        {
            int count = 0;

            byte fillStyleCount = binaryReader.ReadByte();
            count = System.Convert.ToInt32(fillStyleCount);
            ushort fillStyleCountExtended = 0;
            if (fillStyleCount == 0xFF && (shapeType == ShapeType.Shape2 || shapeType == ShapeType.Shape3))
            {
                fillStyleCountExtended = binaryReader.ReadUInt16();
                count = System.Convert.ToInt32(fillStyleCountExtended);
            }

            if (count != 0)
            {
                for (int i = 0; i < count; i++)
                {
                    byte fillStyleType = binaryReader.PeekByte();
                    FillStyle fillStyle = GetFillStyleFromType(fillStyleType);
                    if (fillStyle != null)
                    {
                        fillStyle.ReadData(binaryReader, shapeType);
                        this.Add(fillStyle);
                    }
                }
            }
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:32,代码来源:FillStyle.cs


示例6: ReadData

 /// <summary>
 /// Reads the data for the swf decompilation.
 /// </summary>
 /// <param name="version">Version.</param>
 /// <param name="binaryReader">Binary reader.</param>
 public virtual void ReadData(byte version, BufferedBinaryReader binaryReader)
 {
 }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:8,代码来源:BaseTag.cs


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


示例8: ReadData

 /// <summary>
 /// Reads the data.
 /// </summary>
 /// <param name="version">Version.</param>
 /// <param name="binaryReader">Binary reader.</param>
 public virtual void ReadData(byte version, BufferedBinaryReader binaryReader)
 {
     this.tagType = (FlvTagCodeEnum)binaryReader.ReadByte();
     this.dataSize = binaryReader.ReadUBits(24);
     this.timeStamp = binaryReader.ReadUBits(24);
     binaryReader.ReadUInt32();
 }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:12,代码来源:FlvBaseTag.cs


示例9: ReadData

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

            for (int i = 0; i < numGradients; i++)
            {
                MorphGradRecord morph = new MorphGradRecord();
                morph.ReadData(binaryReader);
                this.Add(morph);
            }
        }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:15,代码来源:MorphGradient.cs


示例10: Init

        /// <summary>
        /// Inits the stream reading process.
        /// </summary>
        /// <param name="path">Path.</param>
        /// <param name="useBuffer">Use buffer.</param>
        private void Init(string path, bool useBuffer)
        {
            Stream stream = File.OpenRead(path);
            if (useBuffer)
            {
                FileInfo fi = new FileInfo(path);

                byte[] buff = new byte[fi.Length];
                stream.Read(buff, 0, System.Convert.ToInt32(fi.Length));
                stream.Close();

                MemoryStream ms = new MemoryStream(buff);
                this.br = new BufferedBinaryReader(ms, false);
            }
            else
            {
                this.br = new BufferedBinaryReader(stream, false);
            }
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:24,代码来源:FlvReader.cs


示例11: FlvReader

 /// <summary>
 /// Creates a new <see cref="FlvReader"/> instance.
 /// </summary>
 /// <param name="stream">Stream.</param>
 public FlvReader(Stream stream)
 {
     this.br = new BufferedBinaryReader(stream, false);
 }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:8,代码来源:FlvReader.cs


示例12: 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)
 {
     Clear();
     for (int i = 0; i < numGlyphs; i++)
     {
         binaryReader.SynchBits();
         Rect fontBound = new Rect();
         fontBound.ReadData(binaryReader);
         Add(fontBound);
     }
 }
开发者ID:Berenold,项目名称:SwfExport,代码行数:16,代码来源:Rect.cs


示例13: 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();
            binaryReader.SynchBits();

            startBounds = new Rect();
            startBounds.ReadData(binaryReader);

            binaryReader.SynchBits();
            endBounds = new Rect();
            endBounds.ReadData(binaryReader);
            binaryReader.SynchBits();

            offset = binaryReader.ReadUInt32();

            morphFillStyles = new MorphFillStyleCollection();
            morphFillStyles.ReadData(binaryReader);

            morphLineStyles = new MorphLineStyleCollection();
            morphLineStyles.ReadData(binaryReader);

            ShapeWithStyle.NumFillBits = (uint)morphFillStyles.Count;
            ShapeWithStyle.NumLineBits = (uint)morphLineStyles.Count;

            startEdges = new ShapeRecordCollection();
            startEdges.ReadData(binaryReader, ShapeType.None);

            ShapeWithStyle.NumFillBits = (uint)morphFillStyles.Count;
            ShapeWithStyle.NumLineBits = (uint)morphLineStyles.Count;

            endEdges = new ShapeRecordCollection();
            endEdges.ReadData(binaryReader, ShapeType.None);
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:39,代码来源:DefineMorphShapeTag.cs


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


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

            soundId = binaryReader.ReadUInt16();

            soundFormat = binaryReader.ReadUBits(4);
            soundRate = binaryReader.ReadUBits(2);
            soundSize = binaryReader.ReadUBits(1);
            soundType = binaryReader.ReadUBits(1);

            soundSampleCount = binaryReader.ReadUInt32();

            uint size = rh.TagLength - 2 - 1 - 4;
            soundData = new byte[size];
            for (uint i = 0; i < size; i++)
                soundData[i] = binaryReader.ReadByte();
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:22,代码来源:DefineSoundTag.cs


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


示例17: 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);
 }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:8,代码来源:EndTag.cs


示例18: ReadData

        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="condActionSize">Size of the cond action.</param>
        public void ReadData(BufferedBinaryReader binaryReader, 
            ushort condActionSize)
        {
            int offset = condActionSize - 5;
            condO = binaryReader.ReadByte();
            condKey = binaryReader.ReadByte();

            actions = binaryReader.ReadBytes(offset);
            byte end = binaryReader.ReadByte();
        }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:15,代码来源:ButtonCondaction.cs


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

            recursion = binaryReader.ReadUInt16();
            timeout = binaryReader.ReadUInt16();
        }
开发者ID:bladecoding,项目名称:SwfExport,代码行数:11,代码来源:ScriptLimitTag.cs


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

            int beforePos = (int)binaryReader.BaseStream.Position;
            int toReaded = (int)rh.TagLength - 7;

            _characterId = binaryReader.ReadUInt16();
            _bitmapFormat = binaryReader.ReadByte();
            _bitmapWidth = binaryReader.ReadUInt16();
            _bitmapHeight = binaryReader.ReadUInt16();
            _bitmapColorTableSize = 0;

            if (_bitmapFormat == 3)
            {
                _bitmapColorTableSize = binaryReader.ReadByte();
                toReaded--;
            }

            if (_bitmapFormat == 3)
            {
                _colorMapData = new ColorMapData();
                _colorMapData.ReadData(binaryReader, _bitmapColorTableSize, _bitmapWidth, _bitmapHeight, toReaded);
            }
            else if (_bitmapFormat == 4 || _bitmapFormat == 5)
            {
                int imageSize = _bitmapWidth * _bitmapHeight;
                int uncompressedSize = imageSize;
                if (_bitmapFormat == 4)
                    uncompressedSize *= 2;
                else
                    uncompressedSize *= 4;

                byte[] uncompressed = new byte[uncompressedSize];
                byte[] compressed = binaryReader.ReadBytes(toReaded);
                Inflater zipInflator = 	new Inflater();
                zipInflator.SetInput(compressed);
                zipInflator.Inflate(uncompressed, 0, uncompressedSize);

                _bitmapColorData = null;
                if (_bitmapFormat == 4)
                {
                    Pix15[] bitmapPixelData = new Pix15[imageSize];
                    for (int i = 0, j = 0; i < imageSize; i++, j += 2)
                    {
                        byte[] data = new byte[2] {uncompressed[j], uncompressed[j+1]};
                        bitmapPixelData[i] = new Pix15(data);
                    }
                    _bitmapColorData = new BitmapColorData(bitmapPixelData);
                }
                else
                {
                    Pix24[] bitmapPixelData = new Pix24[imageSize];
                    for (int i = 0, j = 0; i < imageSize; i++, j += 4)
                    {
                        byte reserved = uncompressed[j];
                        byte red = uncompressed[j + 1];
                        byte green = uncompressed[j + 2];
                        byte blue = uncompressed[j + 3];
                        bitmapPixelData[i] = new Pix24(red, green, blue);
                    }
                    _bitmapColorData = new BitmapColorData(bitmapPixelData);
                }
            }
        }
开发者ID:Berenold,项目名称:SwfExport,代码行数:69,代码来源:DefineBitsLossLessTag.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Clients.WorldClient类代码示例发布时间:2022-05-26
下一篇:
C# Tags.RecordHeader类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap