import java.io.*;
class BufferStream1
{
public static void main(String args[])
{
try
{
BufferedOutputStream out=new BufferedOutputStream(new FileOutputStream("hello.txt"));
out.write("hello world!! my friends".getBytes());
out.close();
}
catch(IOException e)
{
e.printStackTrace();
}
try
{
BufferedInputStream in = new BufferedInputStream(new FileInputStream("hello.txt"));
int c;
while((c=in.read())!=-1)
System.out.print((char)c);
System.out.println();
}
catch(IOException e)
{
e.printStackTrace();
}
}
}