try{
FileWriter fw = new FileWriter("hello.txt");
String s = url+"(on page " + base + ")\n";
fw.write(s,0,s.length()); fw.flush();
}
catch(Exception e)
{e.printStackTrace();}
FileWriter fw = new FileWriter("hello.txt");
String s = url+"(on page " + base + ")\n";
fw.write(s,0,s.length()); fw.flush();
}
catch(Exception e)
{e.printStackTrace();}
int off,
int len)
throws IOException写入字符数组的某一部分。 指定者:
类 Writer 中的 write
参数:
cbuf - 字符缓冲区
off - 开始写入字符处的偏移量
len - 要写入的字符数
调整off的值不就可以了