[Openxml4j-devs] Supporting "Hollow PackageParts"?
Status: Beta
Brought to you by:
neodante
From: Rainer S. <rs...@ad...> - 2008-08-23 20:00:04
|
Hi, I ran into a memory critical situation where one aspect of a solution is ability to get rid of the byte[] storage in MemoryPackagePart. Assuming I have a DOM like tree (XmlBeans) of an XML file, I don't really need the additional byte[] in MemoryPackagePart. XmlBeans allows to get an InputStream from an XML node. This can be returned by <PackagePart>.getInputStreamImpl() . In my adjusted version I added a HollowMemoryPackagePart class and among other things added the method PackagePart.makeHollow(...) . The new class effectively requests the InputStream at save time and does not hold its own buffer. MemoryPackagePart is used as default, so unless makeHollow is called, it remains the same. Would it make sense to add such a feature to openxml4j? If yes, I would be glad to provide a patch. Best wishes, Rainer -- |