第一章Netty,FileChannel常用操作示例
基本读写
try (FileChannel channel = FileChannel.open(Paths.get("test.txt"), StandardOpenOption.READ, StandardOpenOption.WRITE)) {// 写入数据String data = "Hello NIO";ByteBuffer buffer = ByteBuffer.allocate(1024);buffer.put(data.getByte…
2026/6/27 10:32:59