diff options
author | Arne H Juul <arnej@yahoo-inc.com> | 2017-05-30 08:47:48 +0200 |
---|---|---|
committer | Arne H Juul <arnej@yahoo-inc.com> | 2017-05-30 08:47:48 +0200 |
commit | 98a59a3bc5dd2136f416417cf329678fd7c71051 (patch) | |
tree | b9fd0149d44d10f9ef80cb7df969652aa9ae35cb /vespajlib | |
parent | 4f63b1db7661e06343841ab1283e58568240afd7 (diff) |
not really needed to fillBuf() in close()
Diffstat (limited to 'vespajlib')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/io/TeeInputStream.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/io/TeeInputStream.java b/vespajlib/src/main/java/com/yahoo/io/TeeInputStream.java index 7ecd6f0ccea..8da0a017ec0 100644 --- a/vespajlib/src/main/java/com/yahoo/io/TeeInputStream.java +++ b/vespajlib/src/main/java/com/yahoo/io/TeeInputStream.java @@ -20,7 +20,7 @@ class TeeInputStream extends InputStream { private int inBuf() { return writePos - readPos; } - private void fillBuf(boolean block) throws IOException { + private void fillBuf() throws IOException { if (readPos == writePos) { readPos = 0; writePos = 0; @@ -32,7 +32,7 @@ class TeeInputStream extends InputStream { writePos = had; } int wantToRead = CAPACITY - writePos; - if (inBuf() > 0 || !block) { + if (inBuf() > 0) { wantToRead = Math.min(wantToRead, src.available()); } if (wantToRead > 0) { @@ -56,17 +56,12 @@ class TeeInputStream extends InputStream { } public @Override void close() throws IOException { - fillBuf(false); src.close(); dst.close(); } - public @Override void mark(int readlimit) {} - public @Override boolean markSupported() { return false; } - public @Override void reset() {} - public @Override int read() throws IOException { - fillBuf(true); + fillBuf(); if (inBuf() > 0) { int r = buf[readPos++]; return r & 0xff; @@ -82,7 +77,7 @@ class TeeInputStream extends InputStream { if (len <= 0) { return 0; } - fillBuf(true); + fillBuf(); int had = inBuf(); if (had > 0) { len = Math.min(len, had); |