Package com.sun.star.io

Examples of com.sun.star.io.XOutputStream


        throws com.sun.star.uno.RuntimeException, com.sun.star.lang.IllegalArgumentException
    {
        try {
          String sURL = null;
          String sName = null;
          XOutputStream xos = null;
       
        // get interesting values from sourceData   
          for  (int  i = 0 ; i < aSourceData.length; i++)
          {
            sName = aSourceData[i].Name;       
View Full Code Here


    public void loadRootStorageFromBase64(String aBase64) {
        try {
            //Decode and write the data to an temp stream
            byte[] oledata = Base64.decode(aBase64);
            m_RootStream = CreateTempFileStream(m_xMSF);
            XOutputStream xOutput = m_RootStream.getOutputStream();
            xOutput.writeBytes(oledata);
            xOutput.flush();
            //Get the input stream and seek to begin
            XInputStream xInput = m_RootStream.getInputStream();
            XSeekable xSeek = (XSeekable) UnoRuntime.queryInterface(XSeekable.class, xInput);
            xSeek.seek(0);
            oledata = null;
View Full Code Here

            //decode the base64 string
            byte[] oledata = Base64.decode(aBase64);
            //create a temp stream to write data to
            XStream subStream = CreateTempFileStream(m_xMSF);
            XInputStream xInput = subStream.getInputStream();
            XOutputStream xOutput = subStream.getOutputStream();
            //write the length to the temp stream
            byte oleHead[] = new byte[4];
            oleHead[0] = (byte) ((oledata.length >>> 0) & 0xFF);
            oleHead[1] = (byte) ((oledata.length >>> 8) & 0xFF);
            oleHead[2] = (byte) ((oledata.length >>> 16) & 0xFF);
            oleHead[3] = (byte) ((oledata.length >>> 24) & 0xFF);
            xOutput.writeBytes(oleHead);

            // Compress the bytes
            byte[] output = new byte[oledata.length];
            Deflater compresser = new Deflater();
            compresser.setInput(oledata);
            compresser.finish();
            int compressedDataLength = compresser.deflate(output);
            //realloc the data length
            byte[] compressedBytes = new byte[compressedDataLength];
            for (int i = 0; i < compressedDataLength; i++) {
                compressedBytes[i] = output[i];
            }

            //write the compressed data to the temp stream
            xOutput.writeBytes(compressedBytes);
            //seek to 0
            XSeekable xSeek = (XSeekable) UnoRuntime.queryInterface(XSeekable.class, xInput);
            xSeek.seek(0);
            xSeek = null;
            oledata = null;
View Full Code Here

    public void loadRootStorageFromBase64(String aBase64) {
        try {
            //Decode and write the data to an temp stream
            byte[] oledata = Base64.decode(aBase64);
            m_RootStream = CreateTempFileStream(m_xMSF);
            XOutputStream xOutput = m_RootStream.getOutputStream();
            xOutput.writeBytes(oledata);
            xOutput.flush();
            //Get the input stream and seek to begin
            XInputStream xInput = m_RootStream.getInputStream();
            XSeekable xSeek = (XSeekable) UnoRuntime.queryInterface(XSeekable.class, xInput);
            xSeek.seek(0);
            oledata = null;
View Full Code Here

            //decode the base64 string
            byte[] oledata = Base64.decode(aBase64);
            //create a temp stream to write data to
            XStream subStream = CreateTempFileStream(m_xMSF);
            XInputStream xInput = subStream.getInputStream();
            XOutputStream xOutput = subStream.getOutputStream();
            //write the length to the temp stream
            byte oleHead[] = new byte[4];
            oleHead[0] = (byte) ((oledata.length >>> 0) & 0xFF);
            oleHead[1] = (byte) ((oledata.length >>> 8) & 0xFF);
            oleHead[2] = (byte) ((oledata.length >>> 16) & 0xFF);
            oleHead[3] = (byte) ((oledata.length >>> 24) & 0xFF);
            xOutput.writeBytes(oleHead);

            // Compress the bytes
            byte[] output = new byte[oledata.length];
            Deflater compresser = new Deflater();
            compresser.setInput(oledata);
            compresser.finish();
            int compressedDataLength = compresser.deflate(output);
            //realloc the data length
            byte[] compressedBytes = new byte[compressedDataLength];
            for (int i = 0; i < compressedDataLength; i++) {
                compressedBytes[i] = output[i];
            }

            //write the compressed data to the temp stream
            xOutput.writeBytes(compressedBytes);
            //seek to 0
            XSeekable xSeek = (XSeekable) UnoRuntime.queryInterface(XSeekable.class, xInput);
            xSeek.seek(0);
            xSeek = null;
            oledata = null;
View Full Code Here

        throws com.sun.star.uno.RuntimeException, com.sun.star.lang.IllegalArgumentException
    {
        try {
          String sURL = null;
          String sName = null;
          XOutputStream xos = null;
       
        // get interesting values from sourceData   
          for  (int  i = 0 ; i < aSourceData.length; i++)
          {
            sName = aSourceData[i].Name;       
View Full Code Here

            throw new StatusException("Couldn't create instance", e);
        }

        XInputStream xPipeInput = (XInputStream)
            UnoRuntime.queryInterface(XInputStream.class, oPipe);
        XOutputStream xPipeOutput = (XOutputStream)
            UnoRuntime.queryInterface(XOutputStream.class, oPipe);

        XInterface oDataOutput = null;
        try {
            oDataOutput = (XInterface)
View Full Code Here

        // Creating construction :
        // MarkableOutputStream -> Pipe -> MarkableInputStream
        XActiveDataSource xdSmo = (XActiveDataSource)
            UnoRuntime.queryInterface(XActiveDataSource.class, mostream);

        final XOutputStream PipeOut = (XOutputStream)
            UnoRuntime.queryInterface(XOutputStream.class,aPipe);
        final XInputStream PipeIn = (XInputStream)
            UnoRuntime.queryInterface(XInputStream.class,aPipe);

        xdSmo.setOutputStream(PipeOut);

        XActiveDataSink xmSi = (XActiveDataSink)
            UnoRuntime.queryInterface(XActiveDataSink.class, mistream);

        xmSi.setInputStream(PipeIn) ;

        oObj = (XInterface) mostream;

        // all data types for writing to an XDataInputStream
        Vector data = new Vector() ;
        data.add(new Boolean(true)) ;
        data.add(new Byte((byte)123)) ;
        data.add(new Character((char)1234)) ;
        data.add(new Short((short)1234)) ;
        data.add(new Integer(123456)) ;
        data.add(new Float(1.234)) ;
        data.add(new Double(1.23456)) ;
        data.add("DataInputStream") ;
        // information for writing to the pipe
        byte[] byteData = new byte[] {
            1, 2, 3, 4, 5, 6, 7, 8 } ;

        log.println( "creating a new environment for object" );
        TestEnvironment tEnv = new TestEnvironment( oObj );

        tEnv.addObjRelation("StreamData", data);
        tEnv.addObjRelation("ByteData", byteData);
        tEnv.addObjRelation("OutputStream", aPipe);
        tEnv.addObjRelation("Connectable", aConnect);

        //add relation for io.XOutputStream
        final XMultiServiceFactory msf = xMSF;
        tEnv.addObjRelation("XOutputStream.StreamChecker",
            new ifc.io._XOutputStream.StreamChecker() {
                XInputStream xInStream = null;
                public void resetStreams() {
                    if (xInStream != null) {
                        try {
                            xInStream.closeInput();
                            xInStream = null;
                        } catch(com.sun.star.io.IOException e) {
                        }
                    } else {
                        try {
                            PipeOut.closeOutput();
                        } catch(com.sun.star.io.IOException e) {
                        }
                    }
                }
View Full Code Here

        // Creating construction :
        // MarkableOutputStream -> Pipe -> MarkableInputStream
        XActiveDataSource xdSmo = (XActiveDataSource)
            UnoRuntime.queryInterface(XActiveDataSource.class, mostream);

        XOutputStream PipeOut = (XOutputStream)
            UnoRuntime.queryInterface(XOutputStream.class, aPipe);
        XInputStream PipeIn = (XInputStream)
            UnoRuntime.queryInterface(XInputStream.class, aPipe);

        xdSmo.setOutputStream(PipeOut);
View Full Code Here

            UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
        XActiveDataSource xSource = (XActiveDataSource)
            UnoRuntime.queryInterface(XActiveDataSource.class, oObj);

        XInputStream xInput = new MyInput();
        XOutputStream xOutput = new MyOutput();

        xSink.setInputStream(xInput);
        xSource.setOutputStream(xOutput);

        log.println("creating a new environment for object");
View Full Code Here

TOP

Related Classes of com.sun.star.io.XOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.