AutoCloseableAsynchronousByteChannel, AsynchronousChannel, ByteChannel, Channel, DirectoryStream<T>, GatheringByteChannel, InterruptibleChannel, JavaFileManager, MulticastChannel, NetworkChannel, ReadableByteChannel, ScatteringByteChannel, SecureDirectoryStream<T>, SeekableByteChannel, StandardJavaFileManager, WatchService, WritableByteChannelAbstractInterruptibleChannel, AbstractSelectableChannel, AbstractSelector, AsynchronousFileChannel, AsynchronousServerSocketChannel, AsynchronousSocketChannel, BaseFileDescriptor, BufferedInputStream, BufferedOutputStream, BufferedReader, BufferedWriter, ByteArrayInputStream, ByteArrayOutputStream, CharArrayReader, CharArrayWriter, CheckedInputStream, CheckedOutputStream, CipherInputStream, CipherOutputStream, DatagramChannel, DatagramSocket, DataInputStream, DataOutputStream, DeflaterInputStream, DeflaterOutputStream, DigestInputStream, DigestOutputStream, FetchResult, FileChannel, FileInputStream, FileOutputStream, FileReader, FileSystem, FileWriter, FilterInputStream, FilterOutputStream, FilterReader, FilterWriter, Formatter, ForwardingJavaFileManager, GZIPInputStream, GZIPOutputStream, InflaterInputStream, InflaterOutputStream, InputStream, InputStreamReader, JarFile, JarInputStream, JarOutputStream, LineNumberInputStream, LineNumberReader, MulticastSocket, ObjectInputStream, ObjectOutputStream, OutputStream, OutputStreamWriter, Pipe.SinkChannel, Pipe.SourceChannel, PipedInputStream, PipedOutputStream, PipedReader, PipedWriter, PrintStream, PrintWriter, PushbackInputStream, PushbackReader, RandomAccessFile, RawFileDescriptor, Reader, ReliableFileDescriptor.AutoCloseFileInputStream, ReliableFileDescriptor.AutoCloseFileOutputStream, Resource, Scanner, SelectableChannel, Selector, SequenceInputStream, ServerSocket, ServerSocketChannel, Socket, SocketChannel, SSLServerSocket, SSLSocket, StringBufferInputStream, StringReader, StringWriter, URLClassLoader, Writer, ZipFile, ZipInputStream, ZipOutputStreampublic interface Closeable extends AutoCloseable
Closeable is a source or destination of data that can be closed.
The close method is invoked to release resources that the object is
holding (such as open files).void close()
throws IOException
As noted in AutoCloseable#close(), cases where the
close may fail require careful attention. It is strongly advised
to relinquish the underlying resources and to internally
mark the Closeable as closed, prior to throwing
the IOException.
close 在接口中 AutoCloseableIOException - if an I/O error occurs