diff options
author | Arne H Juul <arnej@yahoo-inc.com> | 2017-05-30 09:00:01 +0200 |
---|---|---|
committer | Arne H Juul <arnej@yahoo-inc.com> | 2017-05-30 09:00:01 +0200 |
commit | a8471a5ccca7570b7f556b1b2829ff0977c997dd (patch) | |
tree | 0b0fd1265878cd5e8de9f1b6aade184a463fe83d /vespajlib | |
parent | a57528a5acab7a96f637222239f6b5d6aeaadf34 (diff) |
add comment
Diffstat (limited to 'vespajlib')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/io/TeeInputStream.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/io/TeeInputStream.java b/vespajlib/src/main/java/com/yahoo/io/TeeInputStream.java index 18fbc3ac37a..f9e803df08f 100644 --- a/vespajlib/src/main/java/com/yahoo/io/TeeInputStream.java +++ b/vespajlib/src/main/java/com/yahoo/io/TeeInputStream.java @@ -33,6 +33,7 @@ class TeeInputStream extends InputStream { } int wantToRead = CAPACITY - writePos; if (inBuf() > 0) { + // if we have data already, do not block, read only what is available wantToRead = Math.min(wantToRead, src.available()); } if (wantToRead > 0) { |