BN089-BS开发框架MVC4版/source20131023/Zephyr.Net/Zephyr.Utils/Document/Excel/ExcelLibrary/Office/CompoundDocumentFormat/CompoundDocument.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using QiHe.CodeLib;

namespace Zephyr.Utils.ExcelLibrary.CompoundDocumentFormat
{
    public partial class CompoundDocument : IDisposable
    {
        internal FileHeader Header;
        internal int SectorSize;
        internal int ShortSectorSize;
        private int TotalSectors;
        internal MasterSectorAllocation MasterSectorAllocation;
        internal SectorAllocation SectorAllocation;
        internal ShortSectorAllocation ShortSectorAllocation;

        private MemoryStream ShortStreamContainer;
        private MemoryStream DirectoryStream;
        private Dictionary<int, DirectoryEntry> DirectoryEntries;

        public DirectoryEntry RootStorage
        {
            get { return DirectoryEntries[0]; }
        }

        internal Stream FileStorage;
        private BinaryReader Reader;
        private BinaryWriter Writer;

        internal CompoundDocument(Stream stream, FileHeader header)
        {
            this.FileStorage = stream;
            this.Reader = new BinaryReader(this.FileStorage);
            if (stream.CanWrite)
            {
                this.Writer = new BinaryWriter(this.FileStorage, Encoding.Unicode);
            }

            this.Header = header;
            this.SectorSize = (int)Math.Pow(2, Header.SectorSizeInPot);
            this.ShortSectorSize = (int)Math.Pow(2, Header.ShortSectorSizeInPot);
            this.TotalSectors = stream.Length == 0 ? 0
                : (int)(stream.Length - 512) / this.SectorSize;

            this.MasterSectorAllocation = new MasterSectorAllocation(this);
            this.SectorAllocation = new SectorAllocation(this);
            this.ShortSectorAllocation = new ShortSectorAllocation(this);
        }

        public static CompoundDocument Create(string file)
        {
            FileStream stream = File.Open(file, FileMode.Create, FileAccess.ReadWrite, FileShare.Read);
            return Create(stream);
        }

        public static CompoundDocument Open(string file)
        {
            FileStream stream = File.Open(file, FileMode.Open, FileAccess.ReadWrite, FileShare.Read);
后面还有 220 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。