问题描述:
FileChannel fc = new FileInputStream("data.txt").getChannel();
ByteBuffer buff = ByteBuffer.allocate(1024);
fc.read(buff);
buff.flip();?
while (buff.hasRemaining())?这里判断当前位置与限制为之间是否有元素,
System.out.print((char) buff.get());
ByteBuffer buff = ByteBuffer.allocate(1024);
fc.read(buff);
buff.flip();?
while (buff.hasRemaining())?这里判断当前位置与限制为之间是否有元素,
System.out.print((char) buff.get());
问题解答:
我来补答展开全文阅读