Object mostream = ((XMultiServiceFactory)tParam.getMSF()).createInstance
("com.sun.star.io.MarkableOutputStream");
XActiveDataSink xdSi = (XActiveDataSink)
UnoRuntime.queryInterface(XActiveDataSink.class, istream);
XActiveDataSource xdSo = (XActiveDataSource)
UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
XActiveDataSink xdSmi = (XActiveDataSink)
UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
XActiveDataSource xdSmo = (XActiveDataSource)
UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
XInputStream miStream = (XInputStream)
UnoRuntime.queryInterface(XInputStream.class, mistream);
XOutputStream moStream = (XOutputStream)
UnoRuntime.queryInterface(XOutputStream.class, mostream);
XInputStream PipeIn = (XInputStream)
UnoRuntime.queryInterface(XInputStream.class, aPipe);
XOutputStream PipeOut = (XOutputStream)
UnoRuntime.queryInterface(XOutputStream.class,aPipe);
xdSi.setInputStream(miStream);
xdSo.setOutputStream(moStream);
xdSmi.setInputStream(PipeIn);
xdSmo.setOutputStream(PipeOut);
iStream = (XObjectInputStream)
UnoRuntime.queryInterface(XObjectInputStream.class, istream);
oStream = (XObjectOutputStream)
UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);