Doubt in java programming-2.
hello friends,
I write a program to copy a text file in java.
But i didn't get the text in serial way.
Check out this
I write a program to copy a text file in java.
But i didn't get the text in serial way.
Check out this
import java.io.*;any help will be appreciated.
public class r
{
public static void main(String args[])throws IOException
{
FileInputStream f=new FileInputStream("monu.txt");
InputStreamReader isr=new InputStreamReader(f);
BufferedReader b=new BufferedReader(isr);
char s;
int t;
FileOutputStream ff=new FileOutputStream("kumar.txt");
OutputStreamWriter osr=new OutputStreamWriter(ff);
BufferedWriter br=new BufferedWriter(osr);
do
{
s=(char) b.read();
if((t=b.read())!=1)
br.write(s);
}
while((t=b.read())!=-1);
br.close();
}
}
0