Im getting SelfExpandingBufferredInputStream from client response and I want to convert it into poi XSSFWorkbook. But Im getting below error,
java.lang.UnsupportedOperationException: RESTEASY003000: SelfExpandingBufferredInputStream is always marked at index 0. at org.jboss.resteasy.client.jaxrs.engines.SelfExpandingBufferredInputStream.mark(SelfExpandingBufferredInputStream.java:39) at java.io.FilterInputStream.mark(FilterInputStream.java:201)
below is the sample code used to feed XSSFWorkbook,
final Response httpResponse = webTarget.path(REQUEST_PATH).resolveTemplate("docId", docId)
.request("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")// same error with and without this
.header(RequestInvokerConstants.ACCEPT_TYPE, MediaType.WILDCARD )
.header("context", context).get();
InputStream inputStream = httpResponse.readEntity(InputStream.class);
Workbook workbook = new XSSFWorkbook(inputStream); //getting error in this line
restClient.downloadDocument response will be, "ClientResponse$InputStreamWrapper" and that will be assigned to InputStream
poi-ooxml and poi version is 4.1.2
Thanks in advance!!
InputStream
which doesn't fully comply with the specification. Try wrapping in aBufferedInputStream
?