try {
FileInputStream f1=new FileInputStream("c:/test2.txt");
FileChannel c=f1.getChannel();
FileOutputStream f2=new FileOutputStream("c:/test.txt",true);
FileChannel c1=f2.getChannel();
ByteBuffer fb=ByteBuffer.allocate(1024);
try {
c.read(fb);
fb.put("/r/n".getBytes());
fb.flip();

c1.write(fb);

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
怎么样让输入到test.txt中的内容另起一行?就用通道这种方式。