📄 filechannelexample3.java
字号:
import java.io.*;
import java.nio.*;
import java.nio.channels.*;
public class FileChannelExample3
{
public static void main(String args[]) throws Exception
{
RandomAccessFile fin= new RandomAccessFile("data.txt", "rw");
FileChannel fc = fin.getChannel();
MappedByteBuffer mb = fc.map(FileChannel.MapMode.READ_WRITE, 0, fc.size());
fc.close();
mb.putChar('x');
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -