コード例 #1
0
ファイル: PTCHReader.cs プロジェクト: hanson-huang/Encore
        protected override void Read(BinaryReader reader)
        {
            PTCH = new PTCHChunk(reader);
            MD5 = new MD5Chunk(reader);
            XFRM = new XFRMChunk(reader);

            switch (XFRM.Type)
            {
                case BSD0ChunkName:
                    BSD0 = new BSD0Chunk(reader);
                    BSDIFF40 = BSD0.Unpack();
                    break;
                case COPYChunkName:
                    COPY = new COPYChunk(reader);
                    break;
            }
        }
コード例 #2
0
ファイル: PTCHReader.cs プロジェクト: stweily/Encore
        protected override void Read(BinaryReader reader)
        {
            PTCH = new PTCHChunk(reader);
            MD5  = new MD5Chunk(reader);
            XFRM = new XFRMChunk(reader);

            switch (XFRM.Type)
            {
            case BSD0ChunkName:
                BSD0     = new BSD0Chunk(reader);
                BSDIFF40 = BSD0.Unpack();
                break;

            case COPYChunkName:
                COPY = new COPYChunk(reader);
                break;
            }
        }
コード例 #3
0
ファイル: PTCHReader.cs プロジェクト: chosenmangos/Encore
        private void ReadFile()
        {
            Contract.Ensures(PTCH != null);
            Contract.Ensures(MD5 != null);
            Contract.Ensures(XFRM != null);

            var stream = File.Open(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
            using (var reader = new BinaryReader(stream))
            {
                PTCH = new PTCHChunk(reader);
                MD5 = new MD5Chunk(reader);
                XFRM = new XFRMChunk(reader);

                switch (XFRM.Type)
                {
                    case BSD0ChunkName:
                        BSD0 = new BSD0Chunk(reader);
                        BSDIFF40 = BSD0.Unpack();
                        break;
                    case COPYChunkName:
                        COPY = new COPYChunk(reader);
                        break;
                }
            }

            Contract.Assume(PTCH != null);
            Contract.Assume(MD5 != null);
            Contract.Assume(XFRM != null);
        }