5.在当前目录下写个hello.txt.并用程序输出里面的内容
FileOutputStream outs = new FileOutputStream("./hello.txt");
outs.write("heihei".getbytes());
FileInputStream ins = new FileInputStream("./hello.txt");
byte [] tmp = new byte[1024];
StringBuffer buf = new StringBuffer("");
while((int i=ins.read(tmp))!=-1)
{
buf.append(new String(tmp));
}
System.out.println("content of hello.txt is "+buf.toString());