Package com.sun.star.io

Examples of com.sun.star.io.XStream


    public boolean test()
  {
    try
    {
      XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF );
      if ( xTempFileStream == null )
        return false;
   
      // create storage based on the temporary stream
      Object pArgs[] = new Object[2];
View Full Code Here


    public boolean test()
  {
    try
    {
      XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF );
      if ( xTempFileStream == null )
        return false;
   
      // create storage based on the temporary stream
      Object pArgs[] = new Object[2];
View Full Code Here

          { new StringPair( "Id", "Num4" ), new StringPair( "TargetMode", "Internal" ), new StringPair( "Type", "unknown" ), new StringPair( "Target", "URL value" ) },
          { new StringPair( "Id", "Num5" ), new StringPair( "TargetMode", "" ), new StringPair( "Type", "unknown" ), new StringPair( "Target", "URL value" ) }
        };


      XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF );
      if ( xTempFileStream == null )
        return false;
   
      // create storage based on the temporary stream
      XStorage xTempStorage = m_aTestHelper.createStorageFromStream( m_xStorageFactory,
View Full Code Here

    public boolean test()
  {
    try
    {
      XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF );
      if ( xTempFileStream == null )
        return false;
   
      // create storage based on the temporary stream
      Object pArgs[] = new Object[2];
View Full Code Here

      xClonedSubStorage = null;
      xClonedNameAccess = null;

      // the new stream was opened, written and closed, that means flashed
      // so the clone must contain all the information
      XStream xClonedSubStream = m_aTestHelper.cloneSubStream( xTempStorage, "SubStream1" );
      if ( !m_aTestHelper.InternalCheckStream( xClonedSubStream,
                          "SubStream1",
                          "MediaType1",
                          pBytes1,
                          aRelations1 ) )
View Full Code Here

        return "";
    }
    public XStream CreateTempFileStream( XMultiServiceFactory xMSF )
    {
        // try to get temporary file representation
        XStream xTempFileStream = null;
        try
        {
            Object oTempFile = xMSF.createInstance( "com.sun.star.io.TempFile" );
            xTempFileStream = (XStream)UnoRuntime.queryInterface( XStream.class, oTempFile );
        }
View Full Code Here

        try
        {
          //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);
View Full Code Here

        return "";
    }

    public XStream CreateTempFileStream(XMultiServiceFactory xMSF) {
        // try to get temporary file representation
        XStream xTempFileStream = null;
        try {
            Object oTempFile = xMSF.createInstance("com.sun.star.io.TempFile");
            xTempFileStream = (XStream) UnoRuntime.queryInterface(XStream.class, oTempFile);
        } catch (Exception e) {
        }
View Full Code Here

    public void insertSubStorage(String aName, String aBase64) {
        try {
            //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);
View Full Code Here

            throw new IOException("Need a valid storage not NULL.");
    }
   
    public InputStream createInputStream(String name) throws IOException {
        try{
            final XStream xStream = (XStream) UnoRuntime.queryInterface(XStream.class,input.openStreamElement(name,ElementModes.READ));
            return new BufferedInputStream(new XInputStreamToInputStreamAdapter(xStream.getInputStream()),102400);
        }catch(com.sun.star.uno.Exception e){
            throw new IOException("createInputStream");
        }
    }
View Full Code Here

TOP

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

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.