DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40039>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40039





------- Additional Comments From [EMAIL PROTECTED]  2006-12-18 20:08 -------
I just ran into this myself. The issue stems from using HFFSWorkbook#getBytes()
to create an input stream that eventually gets saved as a file. From the docs
for getBytes() I think it may just be a misunderstanding of what the method
returns. 

Here's what I was doing that caused the problem:

HFFSWorkbook wb = new HFFSWorkbook();
// add sheets, rows, and cells.
return new ByteArrayInputStream(wb.getBytes());

The way I ended up solving this is as follows:

    HFFSWorkbook wb = new HFFSWorkbook();
    // add sheets, rows, and cells.
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try {
        workbook.write(baos);
        return new ByteArrayInputStream(baos.toByteArray());
    } catch (IOException e) {
        try { baos.close(); } catch (IOException ee) { }
    }

- Erik


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/

Reply via email to