Hi,
Am 20.09.2015 um 05:15 schrieb chengangxiong:
it throws exception conversion failed: input document is null after loading
the following code works for me:
XInputStream inputStream = null;
try {
final InputStream inputFile = new BufferedInputStream(
new FileInputStream(sUrl));
final ByteArrayOutputStream bytes = new
ByteArrayOutputStream();
final byte[] byteBuffer = new byte[4096];
int byteBufferLength = 0;
while ((byteBufferLength = inputFile.read(byteBuffer))
> 0)
bytes.write(byteBuffer, 0, byteBufferLength);
inputFile.close();
//
com.sun.star.lib.uno.adapter.ByteArrayToXInputStreamAdapter
inputStream = new ByteArrayToXInputStreamAdapter(
bytes.toByteArray());
} catch (java.io.IOException e) {
e.printStackTrace();
}
Regards
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]