Bug 56437 - [PATCH] Streaming write support in NPOIFS
Summary: [PATCH] Streaming write support in NPOIFS
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POIFS (show other bugs)
Version: 3.11-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-21 14:33 UTC by Andreas Beeker
Modified: 2014-04-21 14:39 UTC (History)
0 users



Attachments
[PATCH] Streaming write support in NPOIFS (23.73 KB, text/plain)
2014-04-21 14:33 UTC, Andreas Beeker
Details

Note You need to log in before you can comment on or make changes to this bug.
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