Reading from a GZIPInputStream (JAVA)


Dear Laurence,

Reading from a GZIPInputStream from a compressed document is the same
as reading from an ordinary InputStream of a decompressed document.
When calling the read method of the GZIPInputStream, the decompressed
bytes are returned. None of the other api’s we have tested like
JExcelApi, POI and other commercial alternatives have any problem
reading from the stream described below and they only support excel
files in their raw format.

Previous message:

In our database all excel documents are stored in the gzip format. When
loading a workbook the following construction is used:

byte[] content = ...;
InputStream in = GZIPInputStream(new ByteArrayInputStream(content));

Workbook book = new Workbook();;

The strange thing is that Apose Excel crashes with the following exception: End of file reached.
at com.aspose.excel.aK.b(Unknown Source)
at com.aspose.excel.aK.d(Unknown Source)
at com.aspose.excel.aK.f(Unknown Source)
at com.aspose.excel.aK.g(Unknown Source)
at com.aspose.excel.aQ.(Unknown Source)
at com.aspose.excel.aZ.a(Unknown Source)
at com.aspose.excel.aZ.(Unknown Source)
at Source)
at com.te.base.util.excel.TEAsposeWorkbook.(
at com.te.base.util.excel.TEWorkbook.getWorkbook(
at com.te.base.util.excel.TEWorkbook.getInstance(

This does not happen if we first decompress the document.

You can easily reproduce this error på gzipping any workbook and loading your Workbook from the following stream:
new GZIPInputStream(new BufferedInputStream(new FileInputStream("book.gz")));

Ulf Ekström


Hi Ulf,

We will check and fix this issue soon.