public POIFSDocument(String name, InputStream stream) throws IOException {
List blocks = new ArrayList();
_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 = (DocumentBlock[]) blocks.toArray(new DocumentBlock[blocks.size()]);