Example #1
0
 private void WriteHeaderV2(BinaryWriter writer, MpkFileEntry entry)
 {
     writer.Write(entry.Id);
     writer.Write(entry.DataOffset);
     writer.Write(entry.CompressedLength);
     writer.Write(entry.Length);
     writer.WriteNullTerminatedString(entry.Name);
 }
Example #2
0
        private MpkFileEntry ReadEntryV2(BinaryReader reader)
        {
            long fileHeaderOffset = reader.BaseStream.Position;
            int  id                 = reader.ReadInt32();
            long offset             = reader.ReadInt64();
            long compressedLength   = reader.ReadInt64();
            long uncompressedLength = reader.ReadInt64();

            if (compressedLength != uncompressedLength)
            {
                IsCompressed = true;
            }

            string name  = reader.ReadNullTerminatedString();
            var    entry = new MpkFileEntry(this, id, name, offset, uncompressedLength, compressedLength);

            entry.FileHeaderOffset = fileHeaderOffset;
            return(entry);
        }