119 Program to demonstrate BufferedOutputStream in Java

Code:
/*
Program to demonstrate BufferedOutputStream
*/

import java.io.*;

class BufferedODemo
{

public static void main(String args[]) throws IOException
{
FileOutputStream fos = new FileOutputStream("t1.txt");
BufferedOutputStream bos = new BufferedOutputStream(fos);

bos.write("Coding Atharva".getBytes());

bos.flush();

System.out.println("Data Written Into a File");
}
}

Ouput:

BufferedOutputStream in Java



Previous
Next Post »