ByteArray...Adapter moved from bean

This commit is contained in:
Michael Hönnig
2004-09-23 13:56:58 +00:00
parent 477a29fce9
commit f5504e09b2
2 changed files with 51 additions and 14 deletions

View File

@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
@@ -745,12 +745,53 @@ public class OOoBean
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.
See storeToURL() for further information.
*/
public byte[] storeToBuffer(
public byte[] storeToByteArray(
byte aOutBuffer[],
final com.sun.star.beans.PropertyValue aArguments[] )
throws
@@ -763,8 +804,8 @@ public class OOoBean
{
// wrap byte arrray into UNO stream
com.sun.star.comp.beans.XOutputStreamToByteArrayAdapter aStream =
new com.sun.star.comp.beans.XOutputStreamToByteArrayAdapter(
com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter aStream =
new com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter(
aOutBuffer );
// add stream to arguments

View File

@@ -2,9 +2,9 @@
#
# $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
# either of the following licenses
@@ -93,10 +93,6 @@ JAVACLASSFILES=\
$(CLASSDIR)$/$(PACKAGE)$/NativeService.class \
$(CLASSDIR)$/$(PACKAGE)$/LocalOfficeConnection.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)$/HasConnectionException.class \
$(CLASSDIR)$/$(PACKAGE)$/NoConnectionException.class \