将ByteBuffer写入并追加到文件
import java.io.File;/** 来 自 N o w J a v a . c o m**/ import java.io.FileOutputStream; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; public class Main { public void m() { // Write bbuf to filename ByteBuffer bbuf = ByteBuffer.wrap("test".getBytes()); File file = new File("filename"); boolean append = false;/** 时 代 J a v a 公 众 号 - nowjava.com 提供 **/ try { // Create a writable file channel FileChannel wChannel = new