Friday, February 14, 2014

Simple program of reading data from the file using buffer.

bufferReader1.java

import java.io.*;

class bufferReader1
{
public static void main(String surat[]) throws IOException
{
FileInputStream f=new FileInputStream("mahi.txt");

BufferedInputStream b=new BufferedInputStream(f);

int i;
while((i=b.read())!=-1)
{
System.out.println((char)i);
}
f.close();
}
}

mahi.txt

Helloooo UI.

Output:


No comments:

Post a Comment