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