private ModulePackageDirectoryEntry ReadDirectoryEntry()
        {
            ModulePackageDirectoryEntry entry;

            entry                   = new ModulePackageDirectoryEntry();
            entry.FileName          = _reader.ReadString();
            entry.FileLocationIndex = _reader.ReadByte();
            entry.FileSize          = _reader.ReadUInt32();
            return(entry);
        }
        // Assumes reader is positioned at that file.
        private ModulePackageFile ReadFile(ModulePackageDirectoryEntry entry)
        {
            ModulePackageFile file;

            byte[] fileBytes;

            fileBytes = new byte[entry.FileSize];
            _reader.Read(fileBytes, 0, (int)entry.FileSize);
            file              = new ModulePackageFile();
            file.FileName     = entry.FileName;
            file.FileLocation = _directory.LocationTable[entry.FileLocationIndex];
            file.FileContents = fileBytes;
            return(file);
        }
Exemple #3
0
 private void WriteDirectoryEntry(ModulePackageDirectoryEntry entry)
 {
     _writer.Write(entry.FileName);
     _writer.Write(entry.FileLocationIndex);
     _writer.Write(entry.FileSize);
 }
Exemple #4
0
 private void WriteDirectoryEntry(ModulePackageDirectoryEntry entry)
 {
     _writer.Write(entry.FileName);
     _writer.Write(entry.FileLocationIndex);
     _writer.Write(entry.FileSize);
 }