public int loadFrom(File file) throws FileNotFoundException {
if (!file.exists()) throw new FileNotFoundException("File does not exist");
return loadFrom(new FileInputStream(file));
}
The FileInputStream is leaked
Change this to:
public int loadFrom(File file) throws FileNotFoundException {
if (!file.exists()) throw new FileNotFoundException("File does not exist");
try(FileInputStream fais = new FileInputStream(file)) {
return this.loadFrom(fais);
}
}