diff options
author | Aidan Butler <aidan@openoffice.org> | 2002-05-20 10:56:11 +0000 |
---|---|---|
committer | Aidan Butler <aidan@openoffice.org> | 2002-05-20 10:56:11 +0000 |
commit | 7d244348cca3cba8cdde33d24497994a2e9fecfa (patch) | |
tree | 57da1950e5b463e3a8e9f4f5b1e99ca5960485d7 /javaunohelper | |
parent | 8a55a4f139b73e5bfad98971b78e49e40c4768cb (diff) |
*** empty log message ***
Diffstat (limited to 'javaunohelper')
-rw-r--r-- | javaunohelper/com/sun/star/lib/uno/adapter/XInputStreamToInputStreamAdapter.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/javaunohelper/com/sun/star/lib/uno/adapter/XInputStreamToInputStreamAdapter.java b/javaunohelper/com/sun/star/lib/uno/adapter/XInputStreamToInputStreamAdapter.java index 71a399a2e77d..684b9602757f 100644 --- a/javaunohelper/com/sun/star/lib/uno/adapter/XInputStreamToInputStreamAdapter.java +++ b/javaunohelper/com/sun/star/lib/uno/adapter/XInputStreamToInputStreamAdapter.java @@ -2,9 +2,9 @@ * * $RCSfile: XInputStreamToInputStreamAdapter.java,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aidan $ $Date: 2002-04-03 09:51:41 $ + * last change: $Author: aidan $ $Date: 2002-05-20 11:56:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -156,7 +156,13 @@ public class XInputStreamToInputStreamAdapter extends InputStream { int count = 0; byte [][] tmp = new byte [1][b.length]; try { - long bytesRead = xin.readBytes(tmp,len); + long bytesRead=0; + if (len >xin.available()) { + bytesRead = xin.readBytes(tmp, xin.available()); + } + else{ + bytesRead = xin.readBytes(tmp,len); + } // Casting bytesRead to an int is okay, since the user can // only pass in an integer length to read, so the bytesRead // must <= len. |