Examples of POIFSBigBlockSize


Examples of org.apache.poi.poifs.common.POIFSBigBlockSize

     *  and the relative index within it.
     * The List of BATBlocks must be in sequential order
     */
    public static BATBlockAndIndex getBATBlockAndIndex(final int offset,
                final HeaderBlock header, final List<BATBlock> bats) {
       POIFSBigBlockSize bigBlockSize = header.getBigBlockSize();
      
       int whichBAT = (int)Math.floor(offset / bigBlockSize.getBATEntriesPerBlock());
       int index = offset % bigBlockSize.getBATEntriesPerBlock();
       return new BATBlockAndIndex( index, bats.get(whichBAT) );
    }
View Full Code Here

Examples of org.apache.poi.poifs.common.POIFSBigBlockSize

     *  and the relative index within it, for the mini stream.
     * The List of BATBlocks must be in sequential order
     */
    public static BATBlockAndIndex getSBATBlockAndIndex(final int offset,
          final HeaderBlock header, final List<BATBlock> sbats) {
       POIFSBigBlockSize bigBlockSize = header.getBigBlockSize();
      
       // SBATs are so much easier, as they're chained streams
       int whichSBAT = (int)Math.floor(offset / bigBlockSize.getBATEntriesPerBlock());
       int index = offset % bigBlockSize.getBATEntriesPerBlock();
       return new BATBlockAndIndex( index, sbats.get(whichSBAT) );
    }
View Full Code Here

Examples of org.apache.poi.poifs.common.POIFSBigBlockSize

      POIDataSamples _samples = POIDataSamples.getPOIFSInstance();
     InputStream inp = _samples.openResourceAsStream("BlockSize4096.zvi");
    
     // First up, check that we can process the header properly
      HeaderBlockReader header_block_reader = new HeaderBlockReader(inp);
      POIFSBigBlockSize bigBlockSize = header_block_reader.getBigBlockSize();
      assertEquals(4096, bigBlockSize.getBigBlockSize());
     
      // Check the fat info looks sane
      assertEquals(109, header_block_reader.getBATArray().length);
      assertTrue(header_block_reader.getBATCount() > 0);
      assertEquals(0, header_block_reader.getXBATCount());
View Full Code Here

Examples of org.apache.poi.poifs.common.POIFSBigBlockSize

   * Bugzilla 48085 describes an error where a corrupted Excel file causes POI to throw an
   * {@link OutOfMemoryError}.
   */
  public void testBadSectorAllocationTableSize_bug48085() {
    int BLOCK_SIZE = 512;
    POIFSBigBlockSize bigBlockSize = POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS;
    assertEquals(BLOCK_SIZE, bigBlockSize.getBigBlockSize());
   
    // 512 bytes take from the start of bugzilla attachment 24444
    byte[] initData = HexRead.readFromString(

    "D0 CF 11 E0 A1 B1 1A E1 20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20 3E 20 03 20 FE FF 09 20" +
View Full Code Here

Examples of org.apache.poi.poifs.common.POIFSBigBlockSize

   * Bugzilla 48085 describes an error where a corrupted Excel file causes POI to throw an
   * {@link OutOfMemoryError}.
   */
  public void testBadSectorAllocationTableSize_bug48085() {
    int BLOCK_SIZE = 512;
    POIFSBigBlockSize bigBlockSize = POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS;
    assertEquals(BLOCK_SIZE, bigBlockSize.getBigBlockSize());
   
    // 512 bytes take from the start of bugzilla attachment 24444
    byte[] initData = HexRead.readFromString(

    "D0 CF 11 E0 A1 B1 1A E1 20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20 3E 20 03 20 FE FF 09 20" +
View Full Code Here

Examples of org.apache.poi.poifs.common.POIFSBigBlockSize

    public BATBlock [] setBATBlocks(final int blockCount,
                                    final int startBlock)
    {
        BATBlock[] rvalue;
        POIFSBigBlockSize bigBlockSize = _header_block.getBigBlockSize();

        _header_block.setBATCount(blockCount);

        // Set the BAT locations
        int limit  = Math.min(blockCount, _max_bats_in_header);
View Full Code Here

Examples of org.apache.poi.poifs.common.POIFSBigBlockSize

     *  and the relative index within it.
     * The List of BATBlocks must be in sequential order
     */
    public static BATBlockAndIndex getBATBlockAndIndex(final int offset,
                final HeaderBlock header, final List<BATBlock> bats) {
       POIFSBigBlockSize bigBlockSize = header.getBigBlockSize();
      
       int whichBAT = (int)Math.floor(offset / bigBlockSize.getBATEntriesPerBlock());
       int index = offset % bigBlockSize.getBATEntriesPerBlock();
       return new BATBlockAndIndex( index, bats.get(whichBAT) );
    }
View Full Code Here

Examples of org.apache.poi.poifs.common.POIFSBigBlockSize

     *  and the relative index within it, for the mini stream.
     * The List of BATBlocks must be in sequential order
     */
    public static BATBlockAndIndex getSBATBlockAndIndex(final int offset,
          final HeaderBlock header, final List<BATBlock> sbats) {
       POIFSBigBlockSize bigBlockSize = header.getBigBlockSize();
      
       // SBATs are so much easier, as they're chained streams
       int whichSBAT = (int)Math.floor(offset / bigBlockSize.getBATEntriesPerBlock());
       int index = offset % bigBlockSize.getBATEntriesPerBlock();
       return new BATBlockAndIndex( index, sbats.get(whichSBAT) );
    }
View Full Code Here

Examples of org.apache.poi.poifs.common.POIFSBigBlockSize

        if(blocks == null || blocks.length == 0) {
           return null;
        }
       
        // Key things about the size of the block
        POIFSBigBlockSize bigBlockSize = blocks[0].bigBlockSize;
        int BLOCK_SHIFT = bigBlockSize.getHeaderValue();
        int BLOCK_SIZE = bigBlockSize.getBigBlockSize();
        int BLOCK_MASK = BLOCK_SIZE - 1;

        // Now do the offset lookup
        int firstBlockIndex = offset >> BLOCK_SHIFT;
        int firstBlockOffset= offset & BLOCK_MASK;
View Full Code Here

Examples of org.apache.poi.poifs.common.POIFSBigBlockSize

    // Header
    HeaderBlock header_block = new HeaderBlock(inp);
    displayHeader(header_block);
   
    // Raw blocks
      POIFSBigBlockSize bigBlockSize = header_block.getBigBlockSize();
      RawDataBlockList data_blocks = new RawDataBlockList(inp, bigBlockSize);
      displayRawBlocksSummary(data_blocks);
     
      // Main FAT Table
      BlockAllocationTableReader batReader =
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.