Code example for BufferedInputStream

Methods: close

0
import java.io.InputStream; 
 
public class TryFinally { 
   
  public void test1(InputStream i1, InputStream i2) throws IOException {
    BufferedInputStream in = new BufferedInputStream(i1);
    try { 
      FileOutputStream zipOut = new FileOutputStream("someFile.txt");
      try { 
        zipOut.write(0);
      } finally { 
        zipOut.close();
      } 
    } finally { 
      in.close();
    } 
  } 
}