示例#1
0
        public void RenderAndSaveMergedFile(string path)
        {
            while (!MergerHelper.IsFileReady(path))
            {
            }

            BinaryWriter bw = new BinaryWriter(File.Open(
                                                   path, FileMode.Open, FileAccess.ReadWrite));

            //write file header
            bw.Write(mergedFile.signatureString);
            bw.Write(mergedFile.version);
            bw.Write(mergedFile.chunkCount);
            bw.Write(mergedFile.chunkTableOffset);
            //write chunks headers
            for (int i = 0; i < mergedFile.chunkCount; i++)
            {
                bw.Write(mergedFile.chunks[i].type);
                bw.Write(mergedFile.chunks[i].version);
                bw.Write(mergedFile.chunks[i].chunkId);
                bw.Write(mergedFile.chunks[i].size);
                bw.Write(mergedFile.chunks[i].pos);
            }
            //write chunks contents
            for (int i = 0; i < mergedFile.chunkCount; i++)
            {
                for (int j = 0; j < mergedFile.chunks[i].size; j++)
                {
                    bw.Write(mergedFile.chunks[i].content[j]);
                }
            }
            bw.Close();
        }
示例#2
0
        void LoadSecondaryFile(string path)
        {
            while (!MergerHelper.IsFileReady(path))
            {
            }

            BinaryReader br = new BinaryReader(File.Open(
                                                   path, FileMode.Open, FileAccess.Read));

            secondaryFile = Load_ChCr_746_File(br);
            br.Close();
        }