コード例 #1
0
 public void Save()
 {
     if (ShortSectorAllocationTable.Count > 0)
     {
         if (Document.Header.FirstSectorIDofShortSectorAllocationTable == SID.EOC)
         {
             int   SecIDCapacity = Document.SectorSize / 4;
             int[] sids          = new Int32[SecIDCapacity];
             for (int i = 0; i < sids.Length; i++)
             {
                 sids[i] = SID.Free;
             }
             Document.Header.FirstSectorIDofShortSectorAllocationTable = Document.AllocateDataSector();
             Document.WriteInSector(Document.Header.FirstSectorIDofShortSectorAllocationTable, 0, sids);
         }
         MemoryStream satStream = new MemoryStream(ShortSectorAllocationTable.Count * 4);
         CompoundDocument.WriteArrayOfInt32(new BinaryWriter(satStream), ShortSectorAllocationTable.ToArray());
         Document.WriteStreamData(Document.Header.FirstSectorIDofShortSectorAllocationTable, satStream.ToArray());
     }
 }
コード例 #2
0
ファイル: SectorAllocation.cs プロジェクト: okevin/chama
 public SectorAllocation(CompoundDocument document)
 {
     this.Document      = document;
     this.SecIDCapacity = document.SectorSize / 4;
 }
コード例 #3
0
 public DirectoryEntry(CompoundDocument document, string name)
     : this(name)
 {
     Document = document;
 }