//随机存储流,可以更改文件字节流的内容
RandomAccessFile randomAccessFile = new RandomAccessFile(encryptFile,"rw");
//从0开始改
randomAccessFile.seek(0);
//要更改的数据
randomAccessFile.write(decipherByte,0,decipherByte.length);
//整个文件的长度,即这个文件有多少个字节
long length = randomAccessFile.length();
//关闭流
randomAccessFile.close();
JAVA中的随机存储流
最新推荐文章于 2022-01-14 23:29:25 发布