monitorjbl / excel-streaming-reader

An easy-to-use implementation of a streaming Excel reader using Apache POI
Apache License 2.0
953 stars 344 forks source link

the difference between read file and inpustream #124

Closed madneal closed 6 years ago

madneal commented 6 years ago

It is recommended to open file instead of opening inpustream in POI. So is it same in excel-streaming-reader. I try to open file instead of inpustream, is this a better solution? I have come across the problem that open xlsx file outofmemory.

monitorjbl commented 6 years ago

There's no difference with this library. It buffers the inputstream to a file.

madneal commented 6 years ago

So, actually this library is still loading the inputstream when open a file? For the sake of memory, I have seen that open a file is better solution to avoid loading inpustream at one time. So it is different here? It will not be better to open a file instead of inputstram, isn't it?

monitorjbl commented 6 years ago

This library is designed to keep memory overhead to a minimum. If you load from an inputstream, the entire stream will be buffered to a file before this library begins parsing it. If load from a file, it will simply read the file and begin parsing it.

There is no difference in memory usage at runtime, but if you have a large file and load it by inputstream it may take some time to buffer at the beginning.

monitorjbl commented 6 years ago

I'm closing this issue but feel free to continue asking questions on it.