poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Burch <nick.bu...@alfresco.com>
Subject Re: Strange behaviour in OPCPackage.open
Date Wed, 20 Oct 2010 15:01:32 GMT
On Wed, 20 Oct 2010, mdirkse wrote:
> Apparently the openxml4j code can handle the file, just not when it's 
> presented as an inputstream. My problem is that, in my code, I can't get 
> at the file, and have to use the inputstream. So how do I prevent it 
> from throwing an OOME whilst still using the inputstream?

Buffer it to a temporary file. Using an inputstream requires way more 
memory than using a file, because the underlying openxml4j needs to be 
able to seek within the zip structure, which for an inputstream means 
buffering

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message