Example #1
0
        public ReadData(Ole2CompoundFile ole2File, Stream inputStream)
        {
            ArrayList list;

            this.ole2File    = ole2File;
            this.inputStream = inputStream;
            BinaryReader br = new BinaryReader(inputStream);

            this.ReadHeader(br, out list);
            this.ReadMATRemainder(br, list);
            this.ReadSAT(br, list);
            this.ReadDirectoryStream(br);
            this.ReadSSAT(br);
            this.ReadShortSectorContainerStream(br);
        }
Example #2
0
        public WriteData(Ole2CompoundFile ole2File, Stream outputStream)
        {
            base.sectorSize                 = 0x200;
            base.shortSectorSize            = 0x40;
            base.shortThreshold             = 0x1000;
            base.sectorAllocationTable      = new ArrayList();
            base.shortSectorAllocationTable = new ArrayList();
            base.shortStreamContainer       = new MemoryStream();
            this.ole2File     = ole2File;
            this.outputStream = outputStream;
            this.BuildTables();
            BinaryWriter bw = new BinaryWriter(outputStream);

            this.WriteHeader(bw);
            this.ole2File.Root.VisitAll(new VisitDirectoryEntryHandler(this.WriteEntry));
            if (base.shortStreamContainerSize > 0)
            {
                this.WriteAllocationTable(bw, base.shortSectorAllocationTable);
                this.WriteShortSectorContainerStream();
            }
            this.WriteDirectoryStream(bw);
            this.WriteAllocationTable(bw, base.sectorAllocationTable);
            this.WriteMATRemainder(bw);
        }