package: java.io
Interface Closeable
All Superinterfaces
AutoCloseable
public interface Closeable
extends AutoCloseable
實現(xiàn)Closeable接口的類一般情況下代表的是某種可以被關閉的數(shù)據(jù)源。通過調用close方法來釋放對象所持有的資源。
方法
close
void close() throws IOException
關閉流并且釋放與流有關的資源。如果流已經關閉,調用該方法不會有任何效果。