connect osl::File with XOutputStream

Hello, All !

I have to save odt file by my program on Qt, if I try to create new file e.g.

osl::File fileOut ("test.odt");;

I have got an error, that file not exists, which way I have to create new file for writing ? And one’s more question, which way I have to connect osl::File to XOutputStream, if I try to

Reference< XComponent > xComponent = _xComponentLoader->loadComponentFromURL(
    buf.toString(), OUString( "_blank" ), 0,
    Sequence < ::com::sun::star::beans::PropertyValue >() );

Reference< XOutputStream > xout (xComponent, UNO_QUERY);

xComponent is a valid not null pointer, but xout is null pointer.