We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ff23d3 commit 0ba6abeCopy full SHA for 0ba6abe
1 file changed
src/main/java/fi/solita/clamav/ClamAVClient.java
@@ -154,10 +154,9 @@ private static byte[] readAll(InputStream is) throws IOException {
154
155
byte[] buf = new byte[2000];
156
int read = 0;
157
- do {
158
- read = is.read(buf);
159
- tmp.write(buf, 0, read);
160
- } while ((read > 0) && (is.available() > 0));
+ while ((read = is.read(buf)) != -1) {
+ tmp.write(buf, 0, read);
+ }
161
return tmp.toByteArray();
162
}
163
0 commit comments