NO-JIRA: Trivial fix for Artemis class, reported by coverity.com

This commit is contained in:
Clebert Suconic 2017-05-05 14:55:44 -04:00
parent a5ea22e8a5
commit c253aa65bf
1 changed files with 10 additions and 6 deletions

View File

@ -179,13 +179,17 @@ public class Artemis {
}
private static long copy(InputStream in, OutputStream out) throws Exception {
byte[] buffer = new byte[1024];
int len = in.read(buffer);
while (len != -1) {
out.write(buffer, 0, len);
len = in.read(buffer);
try {
byte[] buffer = new byte[1024];
int len = in.read(buffer);
while (len != -1) {
out.write(buffer, 0, len);
len = in.read(buffer);
}
return len;
} finally {
in.close();
}
return len;
}
}