Java – will closing datainputstream also close FileInputStream?
•
Java
FileInputStream fstream = new FileInputStream(someFile.getPath());
FileInputStream fstream = new FileInputStream(someFile.getPath()); DataInputStream in = new DataInputStream(fstream);
If I call in Close(), will it also close fstream? My code gives GC exception as follows:
java. Lang. outofmemoryerror: GC overhead limit exceeded
Solution
Yes, datainputstream Close() will also close your FileInputStream
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码