示例#1
0
        public void SaveToFile(String filename)
        {
            KOARBinaryWriter bw = new KOARBinaryWriter(filename);

            bw.Write(GetUncompressedData());
            bw.Close();
        }
示例#2
0
        private void WriteFileTable(KOARBinaryWriter bw)
        {
            bw.WriteInt(_fileTable.Count);

            UInt32 offset = (UInt32)(bw.GetOffset() + _fileTable.Count * 20);

            foreach (BigFileEntryBase file in _fileTable)
            {
                byte[] buffer = file.GetBytes();
                Int32  size   = buffer.Length;

                bw.WriteInt(size);

                // TODO: add compression
                file.SetRaw(true);
                bw.WriteInt(size);

                bw.WriteUInt(offset);
                bw.WriteUInt(file.FileID);
                bw.WriteUInt(file.Flags);

                bw.SavePosition();
                bw.SetOffset(offset);

                bw.Write(buffer);

                offset = (UInt32)bw.GetOffset();

                bw.LoadPosition();
            }
        }
示例#3
0
 private void WriteHeader(KOARBinaryWriter bw)
 {
     bw.Write(Big.SIGNATURE);
     bw.WriteUInt(_version);
     bw.WriteByte(1);
     bw.WriteString(this.BuildString);
     bw.WriteUInt(0x20);
 }
示例#4
0
        public void Build(String filename = null)
        {
            if (filename == null)
            {
                filename = Filename;
            }

            KOARBinaryWriter bw = new KOARBinaryWriter(filename);

            WriteHeader(bw);
            WriteFileTable(bw);

            bw.Close();
        }