Java FilterOutputStream.close()
Syntax
FilterOutputStream.close() has the following syntax.
public void close() throws IOException
Example
In the following code shows how to use FilterOutputStream.close() method.
/*from w w w .java 2 s . co m*/
import java.io.FileOutputStream;
import java.io.FilterOutputStream;
import java.io.OutputStream;
public class Main {
public static void main(String[] args) throws Exception {
// create input streams
OutputStream os = new FileOutputStream("C://test.txt");
FilterOutputStream fos = new FilterOutputStream(os);
// releases any system resources associated with the stream
fos.close();
// writes byte to the output stream
fos.write(65);
}
}
Home »
Java Tutorial »
java.io »
Java Tutorial »
java.io »