// creating and connecting DataOutputStream to the // DataInputStream created through the Pipe
XActiveDataSink xDataSink = UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
// all data types for writing to an XDataInputStream
ArrayList<Object> data = new ArrayList<Object>();
data.add(Boolean.TRUE) ;
data.add(Byte.valueOf((byte)123)) ;
data.add(Character.valueOf((char)1234)) ;
data.add(Short.valueOf((short)1234)) ;
data.add(Integer.valueOf(123456)) ;
data.add(Float.valueOf(1.234f)) ;
data.add(Double.valueOf(1.23456)) ;
data.add("DataInputStream") ; // information for writing to the pipe byte[] byteData = newbyte[] { 1, 2, 3, 4, 5, 6, 7, 8 } ;
// creating a connectable object for XConnectable interface
XInterface xConnect = (XInterface)xMSF.createInstance( "com.sun.star.io.DataInputStream") ;
// creating an input stream to set in XActiveDataSink
XInterface oDataInput = (XInterface) xMSF.createInstance( "com.sun.star.io.Pipe" );
log.println("creating a new environment for object");
TestEnvironment tEnv = new TestEnvironment( oObj );
// adding sequence of data that must be read // by XDataInputStream interface methods
tEnv.addObjRelation("StreamData", data) ; // add a writer
tEnv.addObjRelation("StreamWriter", xDataOutput); // add a connectable
tEnv.addObjRelation("Connectable", xConnect); // add an inputStream
tEnv.addObjRelation("InputStream", oDataInput);
tEnv.addObjRelation("ByteData", byteData);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.