Ejemplo n.º 1
0
 public MasterSectorAllocation(CompoundDocument document)
 {
     this.Document = document;
     this.NumberOfSecIDs = document.Header.NumberOfSATSectors;
     this.CurrentMSATSector = document.Header.FirstSectorIDofMasterSectorAllocationTable;
     this.SecIDCapacity = document.SectorSize / 4 - 1;
     InitializeMasterSectorAllocationTable();
 }
Ejemplo n.º 2
0
 public static CompoundDocument Create(Stream stream)
 {
     CompoundDocument document = new CompoundDocument(stream, new CompoundFileHeader());
     document.WriteHeader();
     document.MasterSectorAllocation.AllocateSATSector();
     document.InitializeDirectoryEntries();
     return document;
 }
Ejemplo n.º 3
0
 public ShortSectorAllocation(CompoundDocument document)
 {
     this.Document = document;
     ShortSectorAllocationTable = document.GetStreamDataAsIntegers(document.Header.FirstSectorIDofShortSectorAllocationTable);
     //ShortSectorAllocationTable.RemoveRange(document.Header.NumberOfShortSectors, ShortSectorAllocationTable.Count - document.Header.NumberOfShortSectors);
     while (ShortSectorAllocationTable.Count > 0 && ShortSectorAllocationTable[ShortSectorAllocationTable.Count - 1] == SID.Free)
     {
         ShortSectorAllocationTable.RemoveAt(ShortSectorAllocationTable.Count - 1);
     }
 }
Ejemplo n.º 4
0
        public static CompoundDocument Open(Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream);
            FileHeader header = ReadHeader(reader);

            CompoundDocument document = new CompoundDocument(stream, header);
            if (!document.CheckHeader()) return null;

            document.ReadDirectoryEntries();

            return document;
        }
Ejemplo n.º 5
0
 public SectorAllocation(CompoundDocument document)
 {
     this.Document = document;
     this.SecIDCapacity = document.SectorSize / 4;
 }