Hi, On Thu, Jun 23, 2011 at 3:11 AM, Nick Burch <[email protected]> wrote:
> On Wed, 22 Jun 2011, Rohit Sharma wrote: > >> The OPCPackage's open method uses an InputStream as the parameter, to >> construct this InputStream from an InputSource ( having a character stream) >> I use the ReaderInputStream class. After this conversion, when the >> processAllSheets method is called, the OPCPackage throws an exception while >> opening this InputStream ( happens for all xlsx files) >> > > I'm not quite following you here, but I'm slightly worried you have the > wrong idea > > You should either pass the File to OPCPackage, or an InputStream that'll > read the contents of the file. The exception you're getting indicates you're > not passing a valid .xlsx file to OPCPackage, possibly because you're doing > something odd with the inputstream > > I am converting an InputSource to an InputStream and passing it on to the OPCPackage, and am getting this exception. I'll look into some more details to find if there's something wrong with the conversion, because if I directly use the InputStream ( without conversion to InputSource ) it works like a charm. Anyway this conversion from InputStream to an InputSource only creates more problems. -- Thanks > Nick > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > [email protected].**org<[email protected]> > For additional commands, e-mail: [email protected] > >
