Example usage for org.apache.poi.poifs.property PropertyTable getRoot

List of usage examples for org.apache.poi.poifs.property PropertyTable getRoot

Introduction

In this page you can find the example usage for org.apache.poi.poifs.property PropertyTable getRoot.

Prototype

public RootProperty getRoot() 

Source Link

Document

Get the root property

Usage

From source file:tv.amwa.maj.io.aaf.AAFReader.java

License:Apache License

/**
 * Read from an InputStream and process the documents we get
 *
 * @param stream the InputStream from which to read the data
 *
 * @exception IOException on errors reading, or on invalid data
 *//*from w  w w  .  j  a  va 2 s . c om*/

public void read(final InputStream stream) throws IOException {
    if (readerListener == null) {
        super.read(stream);
        return;
    }

    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());
}