学习NIO过程中都会讲一个ByteBuffer读写文件的例子,可是我把文件内容换成中文就不OK了1.源码publicclassFileChannelDemo1{//FileChannel读取数据到buffer中publicstaticvoidmain(String[]args)throwsException{//创建FileChannelRandomAccessFileaFile=newRandomAccessFile("d:/中文文本.txt","rw");FileChannelchannel=aFile.getChannel();//创建BufferByteBufferbyteBuffer