I am looking at using POIFileSystem's DocumentInputStream class to read
data. My data is scattered throughout a stream, and so I need random access.
Looking the implementation, we see a DocumentInputStream._current_offset
integer, which points to the current offset. Ideally, I would like to access
As far as I can tell, I can see three options for random access:
(1) Just read the entire stream input a byte array, and read sections I
need. This works, its fast, but is very memory inefficient.
(2) Add an additional method to DocumentInputStream to set the offset
(probably a bad idea), or change _current_offset from private to protected
to allow to it to subclassed (better, but still involves modifying a POIFS
(3) Write my own custom stream, with random access support, e.g.
RandomAccessStream. More tricky, dont want to do this if I dont have to :-)
Any suggestions for how to perform random access reads on a POI
DocumentInputStream would be most appreciated.
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 266.11.12 - Release Date: 17/05/2005