summaryrefslogtreecommitdiff
path: root/bean
diff options
context:
space:
mode:
authorMichael Hönnig <mi@openoffice.org>2004-09-23 13:56:58 +0000
committerMichael Hönnig <mi@openoffice.org>2004-09-23 13:56:58 +0000
commitf5504e09b2c96e4b09ef132eaa4e7069d98eb728 (patch)
tree48c3c84fd8309b11e65f598cfda2171d377eb394 /bean
parent477a29fce9b4636b4c0b2bd73c666d4d3cc4e9b1 (diff)
ByteArray...Adapter moved from bean
Diffstat (limited to 'bean')
-rw-r--r--bean/com/sun/star/comp/beans/OOoBean.java57
-rw-r--r--bean/com/sun/star/comp/beans/makefile.mk8
2 files changed, 51 insertions, 14 deletions
diff --git a/bean/com/sun/star/comp/beans/OOoBean.java b/bean/com/sun/star/comp/beans/OOoBean.java
index 13e39aa0fc35..bfaa7cbd43d2 100644
--- a/bean/com/sun/star/comp/beans/OOoBean.java
+++ b/bean/com/sun/star/comp/beans/OOoBean.java
@@ -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
@@ -746,11 +746,52 @@ public class OOoBean
}
//---------------------------------------------------------------------------
+ /** 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
@@ -788,9 +829,9 @@ public class OOoBean
//-------------------------------------------------------------------------
- // @requirement FUNC.BEAN.PROG/0.5
- // @requirement API.SIM.SEAP/0.2
- /** returns the <type scope="com::sun::star::frame">Frame</a>
+ // @requirement FUNC.BEAN.PROG/0.5
+ // @requirement API.SIM.SEAP/0.2
+ /** returns the <type scope="com::sun::star::frame">Frame</a>
of the bean.
@returns
diff --git a/bean/com/sun/star/comp/beans/makefile.mk b/bean/com/sun/star/comp/beans/makefile.mk
index 40bdfbfa4e13..d93ccd4cd708 100644
--- a/bean/com/sun/star/comp/beans/makefile.mk
+++ b/bean/com/sun/star/comp/beans/makefile.mk
@@ -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 \