ByteArray...Adapter moved from bean
This commit is contained in:
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: OOoBean.java,v $
|
* $RCSfile: OOoBean.java,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.2 $
|
* $Revision: 1.3 $
|
||||||
*
|
*
|
||||||
* last change: $Author: mi $ $Date: 2004-09-14 15:07:23 $
|
* last change: $Author: mi $ $Date: 2004-09-23 14:56:58 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -745,12 +745,53 @@ public class OOoBean
|
|||||||
aCallWatchThread.cancel();
|
aCallWatchThread.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
/** Stores a document to a stream.
|
||||||
|
|
||||||
|
See storeToURL() for further information.
|
||||||
|
*/
|
||||||
|
public java.io.OutputStream storeToStream(
|
||||||
|
java.io.OutputStream aOutStream,
|
||||||
|
final com.sun.star.beans.PropertyValue aArguments[] )
|
||||||
|
throws
|
||||||
|
java.io.IOException,
|
||||||
|
java.lang.InterruptedException,
|
||||||
|
com.sun.star.lang.IllegalArgumentException,
|
||||||
|
|
||||||
|
// @requirement FUNC.CON.LOST/0.2
|
||||||
|
NoConnectionException
|
||||||
|
|
||||||
|
{
|
||||||
|
// wrap Java stream into UNO stream
|
||||||
|
com.sun.star.lib.uno.adapter.OutputStreamToXOutputStreamAdapter aStream =
|
||||||
|
new com.sun.star.lib.uno.adapter.OutputStreamToXOutputStreamAdapter(
|
||||||
|
aOutStream );
|
||||||
|
|
||||||
|
// add stream to arguments
|
||||||
|
com.sun.star.beans.PropertyValue[] aExtendedArguments =
|
||||||
|
addArgument( aArguments, new com.sun.star.beans.PropertyValue(
|
||||||
|
"OutputStream", -1, aStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) );
|
||||||
|
|
||||||
|
// call normal store method
|
||||||
|
storeToURL( "private:stream/", aExtendedArguments );
|
||||||
|
|
||||||
|
// get byte array from document stream
|
||||||
|
try { aStream.closeOutput(); }
|
||||||
|
catch ( com.sun.star.io.NotConnectedException aExc )
|
||||||
|
{ /* TDB */ }
|
||||||
|
catch ( com.sun.star.io.BufferSizeExceededException aExc )
|
||||||
|
{ /* TDB */ }
|
||||||
|
catch ( com.sun.star.io.IOException aExc )
|
||||||
|
{ throw new java.io.IOException(); }
|
||||||
|
return aOutStream;
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
/** Stores a document to a byte array.
|
/** Stores a document to a byte array.
|
||||||
|
|
||||||
See storeToURL() for further information.
|
See storeToURL() for further information.
|
||||||
*/
|
*/
|
||||||
public byte[] storeToBuffer(
|
public byte[] storeToByteArray(
|
||||||
byte aOutBuffer[],
|
byte aOutBuffer[],
|
||||||
final com.sun.star.beans.PropertyValue aArguments[] )
|
final com.sun.star.beans.PropertyValue aArguments[] )
|
||||||
throws
|
throws
|
||||||
@@ -763,8 +804,8 @@ public class OOoBean
|
|||||||
|
|
||||||
{
|
{
|
||||||
// wrap byte arrray into UNO stream
|
// wrap byte arrray into UNO stream
|
||||||
com.sun.star.comp.beans.XOutputStreamToByteArrayAdapter aStream =
|
com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter aStream =
|
||||||
new com.sun.star.comp.beans.XOutputStreamToByteArrayAdapter(
|
new com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter(
|
||||||
aOutBuffer );
|
aOutBuffer );
|
||||||
|
|
||||||
// add stream to arguments
|
// add stream to arguments
|
||||||
@@ -788,9 +829,9 @@ public class OOoBean
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
// @requirement FUNC.BEAN.PROG/0.5
|
// @requirement FUNC.BEAN.PROG/0.5
|
||||||
// @requirement API.SIM.SEAP/0.2
|
// @requirement API.SIM.SEAP/0.2
|
||||||
/** returns the <type scope="com::sun::star::frame">Frame</a>
|
/** returns the <type scope="com::sun::star::frame">Frame</a>
|
||||||
of the bean.
|
of the bean.
|
||||||
|
|
||||||
@returns
|
@returns
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
#
|
#
|
||||||
# $RCSfile: makefile.mk,v $
|
# $RCSfile: makefile.mk,v $
|
||||||
#
|
#
|
||||||
# $Revision: 1.2 $
|
# $Revision: 1.3 $
|
||||||
#
|
#
|
||||||
# last change: $Author: mi $ $Date: 2004-09-14 15:07:23 $
|
# last change: $Author: mi $ $Date: 2004-09-23 14:56:58 $
|
||||||
#
|
#
|
||||||
# The Contents of this file are made available subject to the terms of
|
# The Contents of this file are made available subject to the terms of
|
||||||
# either of the following licenses
|
# either of the following licenses
|
||||||
@@ -93,10 +93,6 @@ JAVACLASSFILES=\
|
|||||||
$(CLASSDIR)$/$(PACKAGE)$/NativeService.class \
|
$(CLASSDIR)$/$(PACKAGE)$/NativeService.class \
|
||||||
$(CLASSDIR)$/$(PACKAGE)$/LocalOfficeConnection.class \
|
$(CLASSDIR)$/$(PACKAGE)$/LocalOfficeConnection.class \
|
||||||
$(CLASSDIR)$/$(PACKAGE)$/LocalOfficeWindow.class \
|
$(CLASSDIR)$/$(PACKAGE)$/LocalOfficeWindow.class \
|
||||||
$(CLASSDIR)$/$(PACKAGE)$/OutputStreamToXOutputStreamAdapter.class \
|
|
||||||
$(CLASSDIR)$/$(PACKAGE)$/InputStreamToXInputStreamAdapter.class \
|
|
||||||
$(CLASSDIR)$/$(PACKAGE)$/XOutputStreamToByteArrayAdapter.class \
|
|
||||||
$(CLASSDIR)$/$(PACKAGE)$/ByteArrayToXInputStreamAdapter.class \
|
|
||||||
$(CLASSDIR)$/$(PACKAGE)$/InvalidArgumentException.class \
|
$(CLASSDIR)$/$(PACKAGE)$/InvalidArgumentException.class \
|
||||||
$(CLASSDIR)$/$(PACKAGE)$/HasConnectionException.class \
|
$(CLASSDIR)$/$(PACKAGE)$/HasConnectionException.class \
|
||||||
$(CLASSDIR)$/$(PACKAGE)$/NoConnectionException.class \
|
$(CLASSDIR)$/$(PACKAGE)$/NoConnectionException.class \
|
||||||
|
Reference in New Issue
Block a user