java - Out of memory when reading xls with Apache poi on Android -


this question has answer here:

i'm attempting create basic spreadsheet (xls) viewer android. while using apache poi api i'm getting out of memory errors when creating new xssfworkbook object:

mworkbook = new xssfworkbook(file); 

how can grab specific rows/cells inside .xls without loading entire file memory?

spreadsheets aren't ideal random access. reason why spreadsheets aren't designed purposed because cells can arbitrarily long, , rows can have arbitrary number of cells in them. if not case , each row had fixed size in bytes, skip reading first (rowsize * indexofrow) bytes of file.

if random access primary use case recommend loading data small database. take @ h2.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -