Закрытие FileInputStream в методе IOUtil.getFD

This commit is contained in:
Victor 2015-04-14 19:27:23 +03:00
parent 42725c7b40
commit ac4d3f0cfc

View File

@ -26,9 +26,11 @@ public final class IOUtil {
return result;
}
private static FileInputStream streamForFD;
public static FileDescriptor getFD(String file) throws IOException {
// TODO: is = ...; result = ..getFD; is.close; return result
return new FileInputStream(ES + file).getFD();
if (streamForFD != null) streamForFD.close();
streamForFD = new FileInputStream(ES + file);
return streamForFD.getFD();
}
public static InputStream open(String file) throws IOException {