summaryrefslogtreecommitdiff
path: root/javaunohelper/com/sun/star/lib/uno/adapter
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-08-02 16:50:27 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-08-02 16:50:27 +0000
commit9fa98489c3964cfc7f93cbc4dd4f12de2ee8b2e0 (patch)
tree5618e77553c3f7b187e09ae54e5b96e182af7138 /javaunohelper/com/sun/star/lib/uno/adapter
parent3cca08d026e2963a96cf383ad053fa21e0a99ffc (diff)
INTEGRATION: CWS insight01 (1.4.94); FILE MERGED
2004/05/04 11:50:31 oj 1.4.94.1: #111075# if available returns zero, assume that available isn't supported by the inputstream
Diffstat (limited to 'javaunohelper/com/sun/star/lib/uno/adapter')
-rw-r--r--javaunohelper/com/sun/star/lib/uno/adapter/XInputStreamToInputStreamAdapter.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/javaunohelper/com/sun/star/lib/uno/adapter/XInputStreamToInputStreamAdapter.java b/javaunohelper/com/sun/star/lib/uno/adapter/XInputStreamToInputStreamAdapter.java
index 684b9602757f..a0e536ca0ee6 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.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: aidan $ $Date: 2002-05-20 11:56:11 $
+ * last change: $Author: hr $ $Date: 2004-08-02 17:50:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -157,8 +157,9 @@ public class XInputStreamToInputStreamAdapter extends InputStream {
byte [][] tmp = new byte [1][b.length];
try {
long bytesRead=0;
- if (len >xin.available()) {
- bytesRead = xin.readBytes(tmp, xin.available());
+ int av = xin.available();
+ if ( av != 0 && len > av) {
+ bytesRead = xin.readBytes(tmp, av);
}
else{
bytesRead = xin.readBytes(tmp,len);
@@ -211,7 +212,7 @@ public class XInputStreamToInputStreamAdapter extends InputStream {
}
} while (tmpLongVal > 0);
- if (avail < n) {
+ if ( avail != 0 && avail < n) {
return(avail);
} else {
return(n);