qq_哭的狠丶低调_0
2017-09-20 13:15
public class RadomAccessFileTest {
public static void main(String[] args) throws IOException {
File file = new File("C:\\Users/Administrator/Desktop/a.txt");
RandomAccessFile raf = new RandomAccessFile(file,"rw");
System.out.println(raf.getFilePointer());
raf.seek(raf.length());
raf.write("a");
}
}
RandomAccessFile 一次只能写一个字节,"a"是个字符串,可以换成'a'或者"a".getBytes();
getBytes()方法可以设置编码类型如gbk,utf-8等
文件传输基础——Java IO流
133754 学习 · 1030 问题
相似问题