示例#1
0
        public DevCompressFileRead(Stream stream)
        {
            this.stream = stream;

            RDevFile read = new RDevFile(stream);

            int tag = read.ReadInt32();

            if (tag == 0xFFEEEE)
            {
                long postion = read.ReadInt64();

                read.Postion = postion;

                tag = read.ReadInt32();

                if (tag == 0xFFEEDD)
                {
                    long length = read.ReadInt64();

                    fileInfoRead = new DevFileInfoRead(stream);

                    long Size = read.ReadInt32();

                    FileList = new Dictionary <string, DevFile>();

                    for (int i = 0; i < Size; i++)
                    {
                        string filename    = read.ReadString();
                        string path        = read.ReadString();
                        bool   isCompuress = read.ReadBoolean();
                        long   complengt   = read.ReadInt64();
                        long   fileSize    = read.ReadInt64();
                        long   index       = read.ReadInt64();

                        DevFile file = new DevFile(filename, path, isCompuress, complengt, fileSize, index, fileInfoRead);
                        FileList.Add(path + filename, file);
                    }
                }
            }
            else
            {
                throw new Exception("ERROR FILE");
            }
        }
示例#2
0
        private void Init()
        {
            RDevFile read = new RDevFile(FileNamet);

            int tag = read.ReadInt32();

            if (tag == 0xFFEEEE)
            {
                long postion = read.ReadInt64();

                read.Postion = postion;

                tag = read.ReadInt32();

                if (tag == 0xFFEEDD)
                {
                    long length = read.ReadInt64();

                    fileInfoRead = new DevFileInfoRead(FileNamev);

                    long Size = read.ReadInt32();

                    FileList = new Dictionary <string, DevFile>();

                    for (int i = 0; i < Size; i++)
                    {
                        string filename    = read.ReadString();
                        string path        = read.ReadString();
                        bool   isCompuress = read.ReadBoolean();
                        long   complengt   = read.ReadInt64();
                        long   fileSize    = read.ReadInt64();
                        long   index       = read.ReadInt64();

                        DevFile file = new DevFile(filename, path, isCompuress, complengt, fileSize, index, fileInfoRead);
                        FileList.Add(path + filename, file);
                    }
                }

                read.Close();
            }
            else
            {
                throw new Exception("ERROR FILE");
            }
        }