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


C# FileReader.ReadBytes方法代码示例

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


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

示例1: LogoFile

        public LogoFile(Stream stream)
        {
            reader = new FileReader(stream);
            reader.ReadBytes(4);//skip Signature
            reader.ReadBytes(4);//skip Version
            guid = reader.ReadGB2312(32);
            uid = (int)(reader.ReadUInt32());

            int len = (int)(reader.ReadUInt32());
            if (len > 0)
            {
                title = reader.ReadGB2312(len);
            }

            len = (int)(reader.ReadUInt32());
            if (len > 0)
            {
                remark = reader.ReadGB2312(len);
            }

            date = reader.ReadGB2312(8);

            rect = new RectangleF();
            rect.X = reader.ReadSingle();
            rect.Y = reader.ReadSingle();
            rect.Width = reader.ReadSingle();
            rect.Height = reader.ReadSingle();

            len = (int)(reader.ReadUInt32());//SymbolBytes
            if (len > 0)
            {
                reader.BaseStream.Seek(len, SeekOrigin.Current);//skip Symbols
            }

            len = (int)(reader.ReadUInt32());//TextBytes
            if (len > 0)
            {
                reader.BaseStream.Seek(len, SeekOrigin.Current);//skip Texts
            }

            len = (int)(reader.ReadUInt32());//ThumbnailBytes
            if (len > 0)
            {
                byte[] thumbnailBytes = new byte[len];
                reader.ReadBytes(len).CopyTo(thumbnailBytes, 0);
                thumbnail = new Thumbnail(thumbnailBytes,ThumbnailType.LogoThumbnail);
                thumbnail.Save(HttpContext.Current.Server.MapPath("/flexLib/Thumbnails/Logos/" + guid + ".png"));
            }
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:49,代码来源:LogoFile.cs

示例2: CardFace

        public CardFace(byte[] bytes,FaceType type)
        {
            faceBytes = bytes;
            faceType = type;

            Stream stream = new MemoryStream(faceBytes);
            FileReader reader = new FileReader(stream);
            reader.ReadBytes(4);//skip Tag 'FACE'
            bgColor = reader.ReadUInt32();
            hasLogo = reader.ReadBoolean();

            byte[] dataBytes;
            byte[] readBytes;
            int len;

            if (hasLogo)
            {
                reader.ReadBytes(16);//skip LogoRect

                logoDepth = reader.ReadUInt32();//LogoDepth

                len = (int)(reader.ReadUInt32());//LogoMatrixBytes
                if (len > 0)
                {
                    logoMatrix = new Matrix(reader.ReadBytes(24));
                }

                len = (int)(reader.ReadUInt32());//LogoColorTransBytes
                if (len > 0)
                {
                    logoColorTrans = new ColorTransform(reader.ReadBytes(32));
                }
            }

            len = (int)(reader.ReadUInt32());//SymbolBytes
            if (len > 0)
            {
                symbols = new SymbolCollection(reader.ReadBytes(len));
            }

            len = (int)(reader.ReadUInt32());//TextBytes
            if (len > 0)
            {
                texts = new TextCollection(reader.ReadBytes(len));
            }

            len = (int)(reader.ReadUInt32());//ThumbnailBytes
            if (len > 0)
            {
                dataBytes=new byte[len];
                readBytes = reader.ReadBytes(len);
                readBytes.CopyTo(dataBytes,0);
                thumbnail = new Thumbnail(dataBytes,ThumbnailType.CardThumbnail);
            }

            stream.Close();
            reader.Close();
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:58,代码来源:CardFace.cs

示例3: CardTempFile

        public CardTempFile(Stream stream)
        {
            reader = new FileReader(stream);
            int len = (int)(reader.ReadUInt32());
            if (len > 0)
            {
                style = reader.ReadGB2312(len);
            }

            Stream cardFileStream = new MemoryStream(reader.ReadBytes((int)(stream.Length - len - 4)));

            cardFile = new CardFile(cardFileStream);
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:13,代码来源:CardTempFile.cs

示例4: CardFile

        public CardFile(Stream stream)
        {
            reader = new FileReader(stream);
            reader.ReadBytes(4);
            reader.ReadBytes(4);
            guid = reader.ReadGB2312(32);
            uid = (int)(reader.ReadUInt32());

            int len = (int)(reader.ReadUInt32());
            if (len > 0)
            {
                name = reader.ReadGB2312(len);
            }

            width = reader.ReadUInt32();
            height = reader.ReadUInt32();

            byte[] faceBytes;
            byte[] readBytes;
            len = (int)(reader.ReadUInt32());//FrontFaceBytes
            if (len > 0)
            {
                faceBytes = new byte[len];
                readBytes = reader.ReadBytes(len);
                readBytes.CopyTo(faceBytes, 0);
                frontFace = new CardFace(faceBytes,FaceType.Front);
            }

            len = (int)(reader.ReadUInt32());//BackFaceBytes
            if (len > 0)
            {
                hasBack = true;
                faceBytes = new byte[len];
                readBytes = reader.ReadBytes(len);
                readBytes.CopyTo(faceBytes, 0);
                backFace = new CardFace(faceBytes, FaceType.Back);
            }
        }
开发者ID:foresightbrand,项目名称:brandqq,代码行数:38,代码来源:CardFile.cs

示例5: ReadHeader

        private void ReadHeader(FileReader Reader)
        {
            Type = (IFFChunkTypes)Enum.Parse(typeof(IFFChunkTypes), Reader.ReadString(4).Replace("#", "").Replace("\0", ""));
            Size = Reader.ReadUInt32();
            ID = Reader.ReadUShort();
            Reader.ReadUShort();  //Flags
            Reader.ReadBytes(64); //Label

            m_Data = Reader.ReadBytes((int)(Size - 76));

            if (!Endian.IsBigEndian)
                Array.Reverse(m_Data); //Data is Little Endian, so needs to be reversed.
        }
开发者ID:Afr0Games,项目名称:Project-Dollhouse,代码行数:13,代码来源:IFFChunk.cs


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