Закрытие FileInputStream в методе IOUtil.getFD
This commit is contained in:
parent
42725c7b40
commit
ac4d3f0cfc
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user