Created attachment 27290 [details] A ZIP file which combines a patch and a test doc. I noticed two issues, both related to the fact that the NPOIFSFileSystem instance isn't propagated correctly everywhere it should be. If I create a HSSFWorkbook from an NPoiFileSystem then 1. I get an NPE in HSSFWorkbook.write(OutputStream stream). It's because it passes a POIFSFileSystem to the copyNodesMethod. The reference is null. The code should check which of the filesystem references is not-null and use the correct one. 2. I get NPEs while working with the HSSFObjectData instances obtained from the HSSFWorkbook.getAllEmbeddedObject. This is because they are all created using a constructor which accepts an POIFSFileSystem. If this is null - problems arise.
NPOIFS doesn't currently support writing. Doesn't matter if you pass the NPOIFS instance along into the write method, it won't help - you can't currently write out Once we've finished the NPOIFS write support, we'll then need to tweak how HSSF does writing The object data is reading so should be fixed, will look into that
Looks like we can fix both easily by just using the DirectoryNode roots, rather than passing in the POIFSFileSystem and immediately getting the root Fixed in r1147179 and r1147183 I've applied your test, with some changes in r1147188, thanks for that!