当前位置: 首页>>代码示例>>C#>>正文


C# POIFSBigBlockSize.GetBATEntriesPerBlock方法代码示例

本文整理汇总了C#中NPOI.POIFS.Common.POIFSBigBlockSize.GetBATEntriesPerBlock方法的典型用法代码示例。如果您正苦于以下问题:C# POIFSBigBlockSize.GetBATEntriesPerBlock方法的具体用法?C# POIFSBigBlockSize.GetBATEntriesPerBlock怎么用?C# POIFSBigBlockSize.GetBATEntriesPerBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NPOI.POIFS.Common.POIFSBigBlockSize的用法示例。


在下文中一共展示了POIFSBigBlockSize.GetBATEntriesPerBlock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CalculateMaximumSize

        /**
         * Calculates the maximum size of a file which is addressable given the
         *  number of FAT (BAT) sectors specified. (We don't care if those BAT
         *  blocks come from the 109 in the header, or from header + XBATS, it
         *  won't affect the calculation)
         *  
         * The actual file size will be between [size of fatCount-1 blocks] and
         *   [size of fatCount blocks].
         *  For 512 byte block sizes, this means we may over-estimate by up to 65kb.
         *  For 4096 byte block sizes, this means we may over-estimate by up to 4mb
         */
        public static int CalculateMaximumSize(POIFSBigBlockSize bigBlockSize,
              int numBATs)
        {
            int size = 1; // Header isn't FAT addressed

            // The header has up to 109 BATs, and extra ones are referenced
            //  from XBATs
            // However, all BATs can contain 128/1024 blocks
            size += (numBATs * bigBlockSize.GetBATEntriesPerBlock());

            // So far we've been in sector counts, turn into bytes
            return size * bigBlockSize.GetBigBlockSize();
        }
开发者ID:xoposhiy,项目名称:npoi,代码行数:24,代码来源:BATBlock.cs

示例2: BATBlock

 protected BATBlock(POIFSBigBlockSize bigBlockSize)
     : base(bigBlockSize)
 {
     int _entries_per_block = bigBlockSize.GetBATEntriesPerBlock();
     _values = new int[_entries_per_block];
     _has_free_sectors = true;
  
     for (int i = 0; i < _values.Length; i++)
         _values[i] = POIFSConstants.UNUSED_BLOCK;
 }
开发者ID:xoposhiy,项目名称:npoi,代码行数:10,代码来源:BATBlock.cs

示例3: CalculateStorageRequirements

 public static int CalculateStorageRequirements(POIFSBigBlockSize bigBlockSize, int entryCount)
 {
     int _entries_per_block = bigBlockSize.GetBATEntriesPerBlock();
     return (entryCount + _entries_per_block - 1) / _entries_per_block;
 }
开发者ID:xoposhiy,项目名称:npoi,代码行数:5,代码来源:BATBlock.cs


注:本文中的NPOI.POIFS.Common.POIFSBigBlockSize.GetBATEntriesPerBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。