Bug 56437

Summary: [PATCH] Streaming write support in NPOIFS
Product: POI Reporter: Andreas Beeker <kiwiwings>
Component: POIFSAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.11-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: [PATCH] Streaming write support in NPOIFS

Description Andreas Beeker 2014-04-21 14:33:48 UTC
Created attachment 31544 [details]
[PATCH] Streaming write support in NPOIFS

This patch adds the following:
- streaming write support in NPOIFS *)
- POIFSWriterListener support in NPOIFS
- fixed/updated NPropertyTable entries on write

While developing this patch, I've tried to stick (i.e. be binary compatible) to the output of POIFS, but apparently this is not necessary. So the parts of the OLE-container look differently when a new file is saved with NPOIFS vs. POIFS:
- The FAT entry: end of file (POIFS) vs. second block (= block 1)
- The first BAT entry: second last block (POIFS) vs. first block (= block 0)
- The data: first block (POIFS) vs. starting with third block
- The property table: third last block (POIFS) vs. the last block (NPOIFS)

To eventually support real streaming to a new file (without having a memory-backed datasource), I've decided to keep the order more or less of the existing implementation, so FAT&BAT entries stay at the same block index and can be updated in-place - maybe it might be necessary to reserve some blocks in the beginning of the file for extended BATs, but that is not the focus of this patch.

*) up till now a byte array was the interface
Comment 1 Andreas Beeker 2014-04-21 14:39:28 UTC
applied with r1588887