帮我看一下这个!!!!
import java.io.*;
import java.nio.*;
import java.nio.channels.FileChannel;
public class Try3
{
public static void main(String[] args)
{
int[] array={1,2,3,4,5,6,7,8,9};
String str="weidongping";
double dbl=100.0;
File aFile=new File("e:/jf/wdp1/file.text");
FileOutputStream file=null;
try{
file=new FileOutputStream(aFile);
}catch(FileNotFoundException e){System.out.println("Usage:FileNotFoundException is catched");}
FileChannel channel=file.getChannel();
ByteBuffer[] bytBuff=new ByteBuffer[3];
bytBuff[0]=bytBuff[0].allocate(8);
bytBuff[1]=bytBuff[1].allocate(8);
bytBuff[0].put(str.getBytes()).flip();
bytBuff[1].putDouble(dbl);
bytBuff[2].allocate(str.length());
bytBuff[2].put(str.getBytes()).flip();
try{
file.write(bytBuff);
}catch(IOException e){System.out.println("write file error"); }
bytBuff[0].clear();
bytBuff[1].clear();
bytBuff[2].clear();
try{
file.close();
}catch(IOException e ){ }
}
}
编译错误提示: write()方法错误,这是怎么回事?????谢谢啦!!!1