Закрытие FileInputStream в методе IOUtil.getFD
This commit is contained in:
parent
42725c7b40
commit
ac4d3f0cfc
@ -26,9 +26,11 @@ public final class IOUtil {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static FileInputStream streamForFD;
|
||||||
public static FileDescriptor getFD(String file) throws IOException {
|
public static FileDescriptor getFD(String file) throws IOException {
|
||||||
// TODO: is = ...; result = ..getFD; is.close; return result
|
if (streamForFD != null) streamForFD.close();
|
||||||
return new FileInputStream(ES + file).getFD();
|
streamForFD = new FileInputStream(ES + file);
|
||||||
|
return streamForFD.getFD();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static InputStream open(String file) throws IOException {
|
public static InputStream open(String file) throws IOException {
|
||||||
|
Loading…
Reference in New Issue
Block a user