Skip to content

Commit c79bc42

Browse files
WS-1518: clean up; add flush
1 parent 8f21268 commit c79bc42

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,14 @@ private static byte[] getBytes(InputStream is) throws IOException {
162162
ByteArrayOutputStream out = new ByteArrayOutputStream();
163163

164164
byte[] buf = new byte[4096];
165-
long total = 0;
166165

167166
while (true) {
168167
int r = is.read(buf);
169168
if (r == -1) {
169+
out.flush();
170170
return out.toByteArray();
171171
}
172172
out.write(buf, 0, r);
173-
total += (long)r;
174173
}
175174
}
176175

0 commit comments

Comments
 (0)