Menu / Java / Librerías / JDK / java.base / java.io / Interfaz Closeable

Interfaz Closeable - Java.

Cuando se implementa Closeable en una clase, indica que se está definiendo un tipo de dato que se debe cerrar.

Ésto se suele utilizar cuando se hace una clase que retiene una propiedad de tipo 'archivo' o similar, que se debe cerrar antes o después dentro de un programa.

Definición:
public interface Closeable extends AutoCloseable { ... }
Implementación:
public class MyClass implements Closeable { ... }

Superinterfaces:

  • java.lang.AutoCloseable

Subinterfaces:

  • AsynchronousByteChannel
  • AsynchronousChannel
  • ByteChannel
  • Channel
  • DirectoryStream <T>
  • GatheringByteChannel
  • ImageInputStream
  • ImageOutputStream
  • InterruptibleChannel
  • JavaFileManager
  • JMXConnector
  • MulticastChannel
  • NetworkChannel
  • ReadableByteChannel
  • RMIConnection
  • ScatteringByteChannel
  • SecureDirectory <T>
  • SeekableByteChannel
  • StandardFileManager
  • WatchService
  • WritableByteChannel

Clases en las que está implementada:

  • AbstractInterruptibleChannel
  • AbstractSelectableChannel
  • AbstractSelector
  • AsynchronousFileChannel
  • AsynchronousServerSocketChannel
  • AudioInputStream
  • BufferedInputStream
  • BufferedOutputStream
  • BufferedReader
  • BufferedWriter
  • ByteArrayInputStream
  • ByteArrayOutputStream
  • CharArrayReader
  • CharArrayWriter
  • CheckedInputStream
  • CheckedOutputStream
  • CipherInputStream
  • CipherOutputStream
  • DatagramChannel
  • DatagramSocket
  • DataInputStream
  • DataOutputStream
  • DeflaterInputStream
  • DeflaterOutputStream
  • DigestInputStream
  • DigestOutputStream
  • FileCacheImageInputStream
  • FileCacheImageOutputStream
  • FileChannel
  • FileImageInputStream
  • FileImageOutputStream
  • FileInputStream
  • FileOutputStream
  • FileReader
  • FileSystem
  • FileWriter
  • GZIPInputStream
  • GZIPOutputStream
  • ImageInputStreamImpl
  • ImageOutputStreamImpl
  • InflaterInputStream
  • InflaterOutputStream
  • InputStream
  • InputStream
  • InputStream
  • InputStreamReader
  • JarFile
  • JarInputStream
  • JarOutputStream
  • LineNumberInputStream
  • LineNumberReader
  • LogStream
  • MemoryCacheImageInputStream
  • MemoryCacheImageOutputStream
  • MLet
  • MulticastSocket
  • ObjectInputStream
  • ObjectOutputStream
  • OutputStream
  • OutputStream
  • OutputStream
  • OutputStreamWriter
  • Pipe.SinkChannel
  • Pipe.SourceChannel
  • PipedInputStream
  • PipedOutputStream
  • PipedReader
  • PipedWriter
  • PrintStream
  • PrintWriter
  • PrivateMLet
  • ProgressMonitorInputStream
  • PushBackInputStream
  • PushBackReader
  • RandomAccessFile
  • Reader
  • RMIConnectionImpl
  • RMIConnectionImpl_Stub
  • RMIConnector
  • RMIIIOPServerImpl
  • RMIJRMPServerImpl
  • RMIServerImpl
  • Scanner
  • SelectableChannel
  • Selector
  • SequenceInputStream
  • ServerSocket
  • ServerSocketChannel
  • SSLSocket
  • StringBufferInputStream
  • StringReader
  • StringWriter
  • URLClassLoader
  • Writer
  • ZipFile
  • ZipInputStream
  • ZipOutputStream

Métodos de Closeable - Java.