// Java BufferedOutputStream class is used
// for buffering an output stream.
// It internally uses buffer to store data.
// It adds more efficiency than to write data directly into a stream.
// So, it makes the performance fast.
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
class BufferedInputStreamDemo {
public static void main(String[] args)
throws FileNotFoundException, IOException {
FileInputStream fis = new FileInputStream("BufferedString.txt");
BufferedInputStream bis = new BufferedInputStream(fis);
int data;
while ((data = bis.read()) != -1) {
System.out.print((char) data);
}
System.out.println();
bis.close();
fis.close();
}
}