Support in-memory sheets (and documents read from an URL)

162 views
Skip to first unread message

Cafebabe

unread,
May 25, 2009, 11:32:28 AM5/25/09
to jOpenDocument
The SpreadSheet-API is very File-oriented. I would like to see a way
of reading SpreadSheets from an URL or from an in memory byte array:

SpreadSheet createFromFile = SpreadSheet.createFromUrl( new URL
(url) );

and

byte[] bytes = ...
SpreadSheet createFromFile = SpreadSheet.createFromBytes( bytes );

Or in general an InputStream. This is much more flexible than a File.

SpreadSheet.create( inputStream );

Instead of saveAs() to a File I would like to see an OutputStream

OutputStream baos = new ByteArrayOutputStream();
sheet.getSpreadSheet().saveAs( baos );

Sylvain Cuaz

unread,
May 28, 2009, 10:49:38 AM5/28/09
to jopend...@googlegroups.com
Cafebabe a écrit :

Hi,

For both you need to use ODPackage :
- SpreadSheet.create(new ODPackage(InputStream))
- SpreadSheet.getPackage().save(OutputStream)

HTH,
Sylvain

Reply all
Reply to author
Forward
0 new messages