Examples of HeaderBlockReader


Examples of org.apache.poi.poifs.storage.HeaderBlockReader

        throws IOException
    {
        this();

        // read the header block from the stream
        HeaderBlockReader header_block_reader = new HeaderBlockReader(stream);

        // read the rest of the stream into blocks
        RawDataBlockList  data_blocks         = new RawDataBlockList(stream);

        // set up the block allocation table (necessary for the
        // data_blocks to be manageable
        new BlockAllocationTableReader(header_block_reader.getBATCount(),
                                       header_block_reader.getBATArray(),
                                       header_block_reader.getXBATCount(),
                                       header_block_reader.getXBATIndex(),
                                       data_blocks);

        // get property table from the document
        PropertyTable properties =
            new PropertyTable(header_block_reader.getPropertyStart(),
                              data_blocks);

        // init documents
        processProperties(SmallBlockTableReader
            .getSmallDocumentBlocks(data_blocks, properties
                .getRoot(), header_block_reader
                    .getSBATStart()), data_blocks, properties.getRoot()
                        .getChildren(), null);
    }
View Full Code Here

Examples of org.apache.poi.poifs.storage.HeaderBlockReader

        throws IOException
    {
        registryClosed = true;

        // read the header block from the stream
        HeaderBlockReader header_block_reader = new HeaderBlockReader(stream);

        // read the rest of the stream into blocks
        RawDataBlockList  data_blocks         = new RawDataBlockList(stream);

        // set up the block allocation table (necessary for the
        // data_blocks to be manageable
        new BlockAllocationTableReader(header_block_reader.getBATCount(),
                                       header_block_reader.getBATArray(),
                                       header_block_reader.getXBATCount(),
                                       header_block_reader.getXBATIndex(),
                                       data_blocks);

        // get property table from the document
        PropertyTable properties =
            new PropertyTable(header_block_reader.getPropertyStart(),
                              data_blocks);

        // process documents
        processProperties(SmallBlockTableReader
            .getSmallDocumentBlocks(data_blocks, properties
                .getRoot(), header_block_reader
                    .getSBATStart()), data_blocks, properties.getRoot()
                        .getChildren(), new POIFSDocumentPath());
    }
View Full Code Here

Examples of org.apache.poi.poifs.storage.HeaderBlockReader

        throws IOException
    {
        registryClosed = true;

        // read the header block from the stream
        HeaderBlockReader header_block_reader = new HeaderBlockReader(stream);

        // read the rest of the stream into blocks
        RawDataBlockList  data_blocks         = new RawDataBlockList(stream, header_block_reader.getBigBlockSize());

        // set up the block allocation table (necessary for the
        // data_blocks to be manageable
        new BlockAllocationTableReader(header_block_reader.getBATCount(),
                                       header_block_reader.getBATArray(),
                                       header_block_reader.getXBATCount(),
                                       header_block_reader.getXBATIndex(),
                                       data_blocks);

        // get property table from the document
        PropertyTable properties =
            new PropertyTable(header_block_reader.getPropertyStart(),
                              data_blocks);

        // process documents
        processProperties(SmallBlockTableReader
            .getSmallDocumentBlocks(data_blocks, properties
                .getRoot(), header_block_reader
                    .getSBATStart()), data_blocks, properties.getRoot()
                        .getChildren(), new POIFSDocumentPath());
    }
View Full Code Here

Examples of org.apache.poi.poifs.storage.HeaderBlockReader

        throws IOException
    {
        this();
        boolean success = false;

        HeaderBlockReader header_block_reader;
        RawDataBlockList data_blocks;
        try {
            // read the header block from the stream
            header_block_reader = new HeaderBlockReader(stream);
            bigBlockSize = header_block_reader.getBigBlockSize();

            // read the rest of the stream into blocks
            data_blocks = new RawDataBlockList(stream, bigBlockSize);
            success = true;
        } finally {
            closeInputStream(stream, success);
        }


        // set up the block allocation table (necessary for the
        // data_blocks to be manageable
        new BlockAllocationTableReader(header_block_reader.getBATCount(),
                                       header_block_reader.getBATArray(),
                                       header_block_reader.getXBATCount(),
                                       header_block_reader.getXBATIndex(),
                                       data_blocks);

        // get property table from the document
        PropertyTable properties =
            new PropertyTable(header_block_reader.getPropertyStart(),
                              data_blocks);

        // init documents
        processProperties(
            SmallBlockTableReader.getSmallDocumentBlocks(
                data_blocks, properties.getRoot(),
                header_block_reader.getSBATStart()
            ),
            data_blocks,
            properties.getRoot().getChildren(),
            null,
            header_block_reader.getPropertyStart()
        );

        // For whatever reason CLSID of root is always 0.
        getRoot().setStorageClsid(properties.getRoot().getStorageClsid());
    }
View Full Code Here

Examples of org.apache.poi.poifs.storage.HeaderBlockReader

  public void test4KBlocks() throws Exception {
      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());
     
      // Now check we can get the basic fat
      RawDataBlockList data_blocks = new RawDataBlockList(inp, bigBlockSize);

    
View Full Code Here

Examples of org.apache.poi.poifs.storage.HeaderBlockReader

        throws IOException
    {
        registryClosed = true;

        // read the header block from the stream
        HeaderBlockReader header_block_reader = new HeaderBlockReader(stream);

        // read the rest of the stream into blocks
        RawDataBlockList  data_blocks         = new RawDataBlockList(stream, header_block_reader.getBigBlockSize());

        // set up the block allocation table (necessary for the
        // data_blocks to be manageable
        new BlockAllocationTableReader(header_block_reader.getBigBlockSize(),
                                       header_block_reader.getBATCount(),
                                       header_block_reader.getBATArray(),
                                       header_block_reader.getXBATCount(),
                                       header_block_reader.getXBATIndex(),
                                       data_blocks);

        // get property table from the document
        PropertyTable properties =
            new PropertyTable(header_block_reader.getBigBlockSize(),
                              header_block_reader.getPropertyStart(),
                              data_blocks);

        // process documents
        processProperties(SmallBlockTableReader
            .getSmallDocumentBlocks(
                  header_block_reader.getBigBlockSize(),
                  data_blocks, properties.getRoot(),
                  header_block_reader.getSBATStart()),
                  data_blocks, properties.getRoot()
                        .getChildren(), new POIFSDocumentPath());
    }
View Full Code Here

Examples of org.apache.poi.poifs.storage.HeaderBlockReader

        throws IOException
    {
        this();
        boolean success = false;

        HeaderBlockReader header_block_reader;
        RawDataBlockList data_blocks;
        try {
            // read the header block from the stream
            header_block_reader = new HeaderBlockReader(stream);
            bigBlockSize = header_block_reader.getBigBlockSize();

            // read the rest of the stream into blocks
            data_blocks = new RawDataBlockList(stream, bigBlockSize);
            success = true;
        } finally {
            closeInputStream(stream, success);
        }


        // set up the block allocation table (necessary for the
        // data_blocks to be manageable
        new BlockAllocationTableReader(header_block_reader.getBigBlockSize(),
                                       header_block_reader.getBATCount(),
                                       header_block_reader.getBATArray(),
                                       header_block_reader.getXBATCount(),
                                       header_block_reader.getXBATIndex(),
                                       data_blocks);

        // get property table from the document
        PropertyTable properties =
            new PropertyTable(bigBlockSize,
                              header_block_reader.getPropertyStart(),
                              data_blocks);

        // init documents
        processProperties(
            SmallBlockTableReader.getSmallDocumentBlocks(
                  bigBlockSize, data_blocks, properties.getRoot(),
                header_block_reader.getSBATStart()
            ),
            data_blocks,
            properties.getRoot().getChildren(),
            null,
            header_block_reader.getPropertyStart()
        );

        // For whatever reason CLSID of root is always 0.
        getRoot().setStorageClsid(properties.getRoot().getStorageClsid());
    }
View Full Code Here

Examples of org.apache.poi.poifs.storage.HeaderBlockReader

        throws IOException
    {
        registryClosed = true;

        // read the header block from the stream
        HeaderBlockReader header_block_reader = new HeaderBlockReader(stream);

        // read the rest of the stream into blocks
        RawDataBlockList  data_blocks         = new RawDataBlockList(stream);

        // set up the block allocation table (necessary for the
        // data_blocks to be manageable
        new BlockAllocationTableReader(header_block_reader.getBATCount(),
                                       header_block_reader.getBATArray(),
                                       header_block_reader.getXBATCount(),
                                       header_block_reader.getXBATIndex(),
                                       data_blocks);

        // get property table from the document
        PropertyTable properties =
            new PropertyTable(header_block_reader.getPropertyStart(),
                              data_blocks);

        // process documents
        processProperties(SmallBlockTableReader
            .getSmallDocumentBlocks(data_blocks, properties
                .getRoot(), header_block_reader
                    .getSBATStart()), data_blocks, properties.getRoot()
                        .getChildren(), new POIFSDocumentPath());
    }
View Full Code Here

Examples of org.apache.poi.poifs.storage.HeaderBlockReader

        throws IOException
    {
        this();

        // read the header block from the stream
        HeaderBlockReader header_block_reader = new HeaderBlockReader(stream);

        // read the rest of the stream into blocks
        RawDataBlockList  data_blocks         = new RawDataBlockList(stream);

        // set up the block allocation table (necessary for the
        // data_blocks to be manageable
        new BlockAllocationTableReader(header_block_reader.getBATCount(),
                                       header_block_reader.getBATArray(),
                                       header_block_reader.getXBATCount(),
                                       header_block_reader.getXBATIndex(),
                                       data_blocks);

        // get property table from the document
        PropertyTable properties =
            new PropertyTable(header_block_reader.getPropertyStart(),
                              data_blocks);

        // init documents
        processProperties(SmallBlockTableReader
            .getSmallDocumentBlocks(data_blocks, properties
                .getRoot(), header_block_reader
                    .getSBATStart()), data_blocks, properties.getRoot()
                        .getChildren(), null);
    }
View Full Code Here

Examples of org.apache.poi.poifs.storage.HeaderBlockReader

  public static void viewFile(final String filename) throws Exception {
    InputStream inp = new FileInputStream(filename);
   
    // Header
    HeaderBlockReader header_block_reader =
       new HeaderBlockReader(inp);
    displayHeader(header_block_reader);
   
    // Raw blocks
      POIFSBigBlockSize bigBlockSize = header_block_reader.getBigBlockSize();
      RawDataBlockList data_blocks = new RawDataBlockList(inp, bigBlockSize);
      displayRawBlocksSummary(data_blocks);
     
      // Main FAT Table
      BlockAllocationTableReader batReader =
         new BlockAllocationTableReader(
            header_block_reader.getBigBlockSize(),
            header_block_reader.getBATCount(),
            header_block_reader.getBATArray(),
            header_block_reader.getXBATCount(),
            header_block_reader.getXBATIndex(),
            data_blocks);
      displayBATReader(batReader);

      // Properties Table
      PropertyTable properties =
         new PropertyTable(
               header_block_reader.getBigBlockSize(),
               header_block_reader.getPropertyStart(),
               data_blocks);
     
      // Mini Fat
      BlockList sbat =
         SmallBlockTableReader.getSmallDocumentBlocks(
               bigBlockSize, data_blocks, properties.getRoot(),
               header_block_reader.getSBATStart()
         );
   }
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.