java - how to convert S3ObjectInputStream to PushbackInputStream -
i uploading excel(xls) file s3 , application should download file s3 , parse using apache poi reader. reader accepts inputstream type input proper parsing of excel expects pushbackinputstream . inputstream file downloaded s3 of type s3objectinputstream . how convert s3objectinputstream pushbackinputstream ? i tried directly passing s3objectinputstream (since inputstream ) pushbackinputstream , resulted in following exception : org.springframework.batch.item.itemstreamexception: failed initialize reader @ org.springframework.batch.item.support.abstractitemcountingitemstreamitemreader.open(abstractitemcountingitemstreamitemreader.java:147) @ org.springframework.batch.item.support.compositeitemstream.open(compositeitemstream.java:96) ..... ..... caused by: java.lang.illegalstateexception: inputstream must either support mark/reset, or wrapped pushbackinputstream @ org.springframework.batch.item.excel.poi.poiitemreader.openexcelfile(poiitemreader.java:82) ..... i tried...