An InputStream requires more memory as it has to buffer the whole file

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: lawrence@krubner.com

This is exactly the opposite of what I’ve always understood, and what I’ve read elsewhere:

When opening a workbook, either a .xls HSSFWorkbook, or a .xlsx XSSFWorkbook, the Workbook can be loaded from either a File or an InputStream. Using a File object allows for lower memory consumption, while an InputStream requires more memory as it has to buffer the whole file.

The stream requires more memory? That is crazy. It’s a stream. And what is a File object if not the whole File all at once?

Crazy.

Source