public FatSector(Stream stream) { Fats = new SectorIndex[XLSFile.MaxSectorIndex]; BinaryReader reader = new BinaryReader(stream); for (int i = 0; i < Fats.Length; ++i) Fats[i] = new SectorIndex(reader.ReadUInt32()); }
public XLSHeader(Stream stream) { BinaryReader reader = new BinaryReader(stream); CheckFormart(reader.ReadUInt64()); ID = new Guid(reader.ReadBytes(16)); MinorVer = reader.ReadUInt16(); DllVer = reader.ReadUInt16(); ByteOrder = reader.ReadUInt16(); Shift = reader.ReadUInt16(); MiniShift = reader.ReadUInt16(); Reserved = reader.ReadUInt16(); Reserved1 = reader.ReadUInt32(); Reserved2 = reader.ReadUInt32(); FatCount = reader.ReadUInt32(); DirStart = new SectorIndex(reader.ReadUInt32()); Signature = reader.ReadUInt32(); MiniSectorCutoff = reader.ReadUInt32(); MiniFatStart = new SectorIndex(reader.ReadUInt32()); MiniFatCount = reader.ReadUInt32(); DifStart = new SectorIndex(reader.ReadUInt32()); DifCount = reader.ReadUInt32(); Fats = new SectorIndex[109]; for (int i = 0; i < Fats.Length; i++) { Fats[i] = new SectorIndex(reader.ReadUInt32()); } }
private void SetData(long length, SectorIndex dataOffset, List <Sector> sectors, List <SectorIndex> index) { if (!dataOffset.IsEndOfChain) { int left = (int)length; MemoryStream stream = new MemoryStream(Data); SectorIndex sect = dataOffset; do { try { Storage sector = (Storage)sectors[sect.ToInt()]; int toWrite = Math.Min(sector.Data.Length, left); stream.Write(sector.Data, 0, toWrite); left -= toWrite; sect = index[sect.ToInt()]; } catch (Exception) { return; } } while (!sect.IsEndOfChain); } }
public XLSStreamDirectory(string name, long length, SectorIndex dataOffset, List <Sector> sectors, List <SectorIndex> index) : base(name) { Length = length; Data = new byte[length]; SetData(length, dataOffset, sectors, index); }
public MiniFatSector(Stream stream) { BinaryReader reader = new BinaryReader(stream); for (int i = 0; i < Fats.Length; ++i) { Fats[i] = new SectorIndex(reader.ReadUInt32()); } }
public DifSector(Stream stream) { BinaryReader reader = new BinaryReader(stream); Fats = new SectorIndex[127]; for (int i = 0; i < Fats.Length; ++i) Fats[i] = new SectorIndex(reader.ReadUInt32()); NextDif = new SectorIndex(reader.ReadUInt32()); }
public FatSector(Stream stream) { Fats = new SectorIndex[XLSFile.MaxSectorIndex]; BinaryReader reader = new BinaryReader(stream); for (int i = 0; i < Fats.Length; ++i) { Fats[i] = new SectorIndex(reader.ReadUInt32()); } }
public DifSector(Stream stream) { BinaryReader reader = new BinaryReader(stream); Fats = new SectorIndex[127]; for (int i = 0; i < Fats.Length; ++i) { Fats[i] = new SectorIndex(reader.ReadUInt32()); } NextDif = new SectorIndex(reader.ReadUInt32()); }
private List <DirectorySectorData> SetDirs(XLSHeader header, List <Sector> sectors, List <SectorIndex> index) { var dirs = new List <DirectorySectorData>(); for (SectorIndex dirSect = header.DirStart; !dirSect.IsEndOfChain; dirSect = index[dirSect.ToInt()]) { DirectorySector dir = new DirectorySector(sectors[dirSect.ToInt()].ToStorage().ToStream()); foreach (DirectorySectorData entry in dir.Entries) { dirs.Add(entry); } sectors[dirSect.ToInt()] = dir; } return(dirs); }
public DirectorySectorData(Stream stream) { BinaryReader reader = new BinaryReader(stream); SetName(reader); Type = (Stgty)reader.ReadByte(); Color = (DeColor)reader.ReadByte(); LeftSibling = new SectorIndex(reader.ReadUInt32()); RightSibling = new SectorIndex(reader.ReadUInt32()); Child = new SectorIndex(reader.ReadUInt32()); ID = new Guid(reader.ReadBytes(16)); UserFlags = reader.ReadUInt32(); CreateTimeStamp = reader.ReadUInt64(); ModifyTimeStamp = reader.ReadUInt64(); Start = new SectorIndex(reader.ReadUInt32()); Size = reader.ReadUInt32(); PropType = reader.ReadUInt16(); Padding = reader.ReadUInt16(); }