01 2018 档案
一个使用FileChannel读取数据到Buffer中的示例:
摘要:RandomAccessFile aFile = new RandomAccessFile("data/nio-data.txt", "rw"); FileChannel inChannel = aFile.getChannel(); ByteBuffer buf = ByteBuffer.allocate(48); int bytesRead = inChannel.read(buf); ... 阅读全文
posted @ 2018-01-13 16:41 waytods 阅读(211) 评论(0) 推荐(0)