|
@@ -252,13 +252,14 @@ public class JenkinsHash extends Hash {
|
|
|
System.err.println("Usage: JenkinsHash filename");
|
|
|
System.exit(-1);
|
|
|
}
|
|
|
- FileInputStream in = new FileInputStream(args[0]);
|
|
|
- byte[] bytes = new byte[512];
|
|
|
- int value = 0;
|
|
|
- JenkinsHash hash = new JenkinsHash();
|
|
|
- for (int length = in.read(bytes); length > 0 ; length = in.read(bytes)) {
|
|
|
- value = hash.hash(bytes, length, value);
|
|
|
+ try (FileInputStream in = new FileInputStream(args[0])) {
|
|
|
+ byte[] bytes = new byte[512];
|
|
|
+ int value = 0;
|
|
|
+ JenkinsHash hash = new JenkinsHash();
|
|
|
+ for (int length = in.read(bytes); length > 0; length = in.read(bytes)) {
|
|
|
+ value = hash.hash(bytes, length, value);
|
|
|
+ }
|
|
|
+ System.out.println(Math.abs(value));
|
|
|
}
|
|
|
- System.out.println(Math.abs(value));
|
|
|
}
|
|
|
}
|