码迷,mamicode.com
首页 > 其他好文 > 详细

接口 Closeable

时间:2017-04-14 20:53:15      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:iter   file   nec   cin   obj   详细信息   out   progress   ges   

java.io
接口 Closeable


public interface Closeable

Closeable 是可以关闭的数据源或目标。调用 close 方法可释放对象保存的资源(如打开文件)。

 

从以下版本开始:1.5

方法摘要
 void  close() 关闭此流并释放与此流关联的所有系统资源。

 

方法详细信息

close

void close()
           throws IOException
关闭此流并释放与此流关联的所有系统资源。如果已经关闭该流,则调用此方法无效。

 

抛出:
IOException - 如果发生 I/O 错误

 

所有已知子接口:
ByteChannel, Channel, GatheringByteChannel, InterruptibleChannel, JavaFileManager, JMXConnector, ReadableByteChannel, RMIConnection, ScatteringByteChannel, StandardJavaFileManager, WritableByteChannel
所有已知实现类:
AbstractInterruptibleChannel, AbstractSelectableChannel, AudioInputStream, BufferedInputStream, BufferedOutputStream, BufferedReader, BufferedWriter, ByteArrayInputStream, ByteArrayOutputStream, CharArrayReader, CharArrayWriter, CheckedInputStream, CheckedOutputStream, CipherInputStream, CipherOutputStream, DatagramChannel, DataInputStream, DataOutputStream, DeflaterInputStream, DeflaterOutputStream, DigestInputStream, DigestOutputStream, FileChannel, FileInputStream, FileOutputStream, FileReader, FileWriter, FilterInputStream, FilterOutputStream, FilterReader, FilterWriter, Formatter, ForwardingJavaFileManager, GZIPInputStream, GZIPOutputStream, InflaterInputStream, InflaterOutputStream, InputStream,  InputStreamReader, JarInputStream, JarOutputStream, LineNumberInputStream, LineNumberReader, LogStream, ObjectInputStream, ObjectOutputStream, OutputStream, OutputStream, OutputStreamWriter, Pipe.SinkChannel, Pipe.SourceChannel, PipedInputStream, PipedOutputStream, PipedReader, PipedWriter, PrintStream, PrintWriter, ProgressMonitorInputStream, PushbackInputStream, PushbackReader, RandomAccessFile, Reader, RMIConnectionImpl, RMIConnectionImpl_Stub, RMIConnector, RMIIIOPServerImpl, RMIJRMPServerImpl, RMIServerImpl, SelectableChannel, SequenceInputStream, ServerSocketChannel, SocketChannel, StringBufferInputStream, StringReader, StringWriter, Writer, ZipInputStream, ZipOutputStream

接口 Closeable

标签:iter   file   nec   cin   obj   详细信息   out   progress   ges   

原文地址:http://www.cnblogs.com/maokun/p/6710452.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!