public POIFSDocument(String name, InputStream stream) throws IOException {
List<DocumentBlock> blocks = new ArrayList<DocumentBlock>();
_size = 0;
while (true) {
DocumentBlock block = new DocumentBlock(stream);
int blockSize = block.size();
if (blockSize > 0) {
blocks.add(block);
_size += blockSize;
}
if (block.partiallyRead()) {
break;
}
}
DocumentBlock[] bigBlocks = blocks.toArray(new DocumentBlock[blocks.size()]);