Package com.sun.star.io

Examples of com.sun.star.io.XStream


     * @return the outputstream
     * @throws IOException if opening the stream fails
     */
    public OutputStream createOutputStream(String name, String mimeType) throws IOException {
        try{
            final XStream stream = (XStream) UnoRuntime.queryInterface(XStream.class,output.openStreamElement(name,ElementModes.WRITE|ElementModes.TRUNCATE));
            stream.getInputStream().closeInput();
            if (mimeType != null)
            {
                final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,stream);
                prop.setPropertyValue("MediaType",mimeType);
            }
            return new BufferedOutputStream(new XOutputStreamToOutputStreamAdapter(stream.getOutputStream()),204800);
        }catch(com.sun.star.uno.Exception e){
            throw new IOException("createOutputStream");
        }
    }
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.cloneEncrSubStream( xTempStorage, "SubStream1", sPass1 );
      if ( !m_aTestHelper.InternalCheckStream( xClonedSubStream, "SubStream1", "MediaType1", pBytes1 ) )
        return false;

      if ( !m_aTestHelper.disposeStream( xClonedSubStream, "SubStream1" ) )
        return false;
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

    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 ) )
        return false;

      if ( !m_aTestHelper.disposeStream( xClonedSubStream, "SubStream1" ) )
        return false;
View Full Code Here

      if ( !m_aTestHelper.cantOpenStorage( xTempFileStorage, "SubStorage1" ) )
        return false;


      // reopen created streams
      XStream xSubStream1 = m_aTestHelper.OpenStream( xSubSubStorage,
                              "SubStream1",
                              ElementModes.WRITE | ElementModes.NOCREATE );
      XStream xSubStream2 = m_aTestHelper.OpenStream( xSubSubStorage,
                              "SubStream2",
                              ElementModes.READ | ElementModes.NOCREATE );
      if ( xSubStream1 == null || xSubStream2 == null )
        return false;

      // it should be possible to have more then one copy of stream for reading
      XStream xSubStream2clone = m_aTestHelper.OpenStream( xSubSubStorage,
                                "SubStream2",
                                ElementModes.READ | ElementModes.NOCREATE );
      if ( xSubStream2 == null )
        return false;
View Full Code Here

    public boolean test()
  {
    try
    {
      XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF );
      if ( xTempFileStream == null )
        return false;

      if ( true )
      {
View Full Code Here

      // ================================================
      // create a temporary stream and a storage based on it
      // fill the storage with the data that will be used for testing
      // ================================================

      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( "TargetType", "Internal" ), new StringPair( "Type", "unknown" ), new StringPair( "Target", "URL value" ) },
          { new StringPair( "Id", "Num5" ), new StringPair( "TargetType", "" ), 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

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.