做网站遇到各种问题,visualstudio网页设计作业,服务好的高端网站建设,wordpress默认注册全屏java.io.FilterInputStream.close()方法关闭此输入流并释放与该流关联的所有系统资源。声明以下是public void close() 方法的声明#xff1a;public void close()参数NA返回值该方法不返回任何值。异常IOException -- 如果发生I/ O错误。例子下面的例子显示了public void…全屏java.io.FilterInputStream.close()方法关闭此输入流并释放与该流关联的所有系统资源。声明以下是public void close() 方法的声明public void close()参数NA返回值该方法不返回任何值。异常IOException -- 如果发生I/ O错误。例子下面的例子显示了public void close()方法的用法。package cn.sxt;import java.io.BufferedInputStream;import java.io.FileInputStream;import java.io.FilterInputStream;import java.io.IOException;import java.io.InputStream;public class FilterInputStreamDemo {public static void main(String[] args) throws Exception {InputStream is null;FilterInputStream fis null;try{// create input streamsis new FileInputStream(C://test.txt);fis new BufferedInputStream(is);// closes and releases the associated system resourcesfis.close();// read is called after close() invocationfis.read();}catch(IOException e){System.out.print(stream is closed prior ot this call);}finally{// releases any system resources associated with the streamif(is!null)is.close();if(fis!null)fis.close();}}}假设我们有一个文本文件c:/ test.txt它具有以下内容。该文件将被用作输入到我们的示例程序ABCDEF让我们来编译和运行上面的程序这将产生以下结果stream is closed prior ot this call分享到0评论