Return-Path: X-Original-To: apmail-openoffice-dev-archive@www.apache.org Delivered-To: apmail-openoffice-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BB1BC10982 for ; Thu, 20 Jun 2013 08:56:53 +0000 (UTC) Received: (qmail 63366 invoked by uid 500); 20 Jun 2013 08:56:53 -0000 Delivered-To: apmail-openoffice-dev-archive@openoffice.apache.org Received: (qmail 63306 invoked by uid 500); 20 Jun 2013 08:56:52 -0000 Mailing-List: contact dev-help@openoffice.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openoffice.apache.org Delivered-To: mailing list dev@openoffice.apache.org Received: (qmail 63294 invoked by uid 99); 20 Jun 2013 08:56:52 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jun 2013 08:56:52 +0000 Received: from localhost (HELO localhost) (127.0.0.1) (smtp-auth username arielch, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jun 2013 08:56:51 +0000 Date: Thu, 20 Jun 2013 05:56:48 -0300 From: Ariel Constenla-Haile To: dev@openoffice.apache.org Subject: Re: OpenCommandArgument2 Data Sink Message-ID: <20130620085648.GB5499@localhost> References: <20130619193821.GA12750@localhost> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kORqDWCi7qDJ0mEj" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) --kORqDWCi7qDJ0mEj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 20, 2013 at 01:56:09PM +0530, Rajath Shashidhara wrote: > Can I use this? > http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io= /IOUtils.html I doubt this knows how to handle css.io.XInputStream and css.io.XOutputStream. Copying from an XInputInstream to an XOutputStream is rather straight-forward: use a buffer to read bytes from the XInputStream, write the buffer onto the XOutputstream, close the streams when finished. http://www.openoffice.org/api/docs/common/ref/com/sun/star/io/XOutputStream= =2Ehtml http://www.openoffice.org/api/docs/common/ref/com/sun/star/io/XInputStream.= html Note that your implementation of CMISInputStream.readBytes() is assuming that the buffer is not null and has enough space; and the code that calls this may request to read more bytes than available. In all these cases, your implementation of readBytes() will fail, but it shouldn't. Regards --=20 Ariel Constenla-Haile La Plata, Argentina --kORqDWCi7qDJ0mEj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) iQIcBAEBCAAGBQJRwsPQAAoJEMjP1bm45QNWwKEQAKEAq+cNJ+t8XnssKWnc4c15 moOUCSxdvXJu7kdIwDPxuro9DoerauA5FAmF/M0ig7QQBCrHxcVVRwNXTXBNfPL1 PyNh7+HZN3G7F2aujP0FwCGqVUYIyYXttDngTMgHJLiaNlIRr8RCvnGlnO7cLIu1 WxfGbYX9mWtJ4vqueB0gz9dGhahh4KAy8N+go6fz4Tq+B605SlvbcAazUjGKOPS8 DcQr2iMrlQTD2KSWMREuYYx9iDcXAUPhcTBFD1fg79a4qFbOlISV6sjwTR+IzWQ2 ar4jXqFQ4IMRye0nuQyrBgcC4hgfrEKmypbIJKfA9nzoK1nPa55wyAtXWLMsoTv+ GxBO9NUgZdztfFtyx2JoC/j+8RCcXPh3GkvMdRYZ/RBI/jTLQzmCJWOFDQJlnIdI w4YLhGhgfju267ejHsq3VltFy1FSUkAPU7EAsCet+qO2cX0m33wGCd+Py6Sq/YuJ nHKChwaYQuN60IsTu9HnWHgQsSwOhtXFQ6ZQtlg59lWWBtvaEjQ382sHSkvXiz6F 6OdcU+w1Ggb6c4yDSG7g3lz7MjXe2LgFpGY2UNGR9APHLZCxDXw6XXH1HJnydp0m wiTRHcSkFhNCTXcyAQHkkshmBd127nM3JjBCJnVYsxRKXyZ5n2AqzkJEy2AXKqMy 875Ur3Z43iL8Ugk6L7J8 =99+6 -----END PGP SIGNATURE----- --kORqDWCi7qDJ0mEj--