RandomeAccessFile

use write replace writeBytes

public class RandomAccessFileTest {
public static void main(String[] args) {
try {
RandomAccessFile file= new RandomAccessFile("c://temp//in.txt","rw");
System.out.println(file.readLine()); file.seek(file.length());
//clear all
// file.setLength(0l); //use write() to replace writeBytes
file.write("hello ross test".getBytes());
//writeBytes will has issue on UTF8
// file.writeBytes("");
file.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

最新文章

  1. Python之路【第六篇】python基础 之面向对象(一)
  2. Xcode 7免证书真机调试
  3. dotNet下的一套解决方案
  4. Spirng中Mongodb中write-concern的解释
  5. iscroll性能
  6. Best Cow Fences_二分&&DP
  7. 2013ACM/ICPC亚洲区南京站现场赛——题目重现
  8. Kali vmtools
  9. codeforces 653D D. Delivery Bears(二分+网络流)
  10. 原生js的兼容问题总结
  11. linux ptrace I
  12. 基于visual Studio2013解决面试题之0409判断一个栈是否另外一个栈的弹出序列
  13. 自动生成数学题型三 (框架Struts2)题型如 a+b=c(a、b、c都为分数)
  14. 使用Google Cloud Platform构建机器学习项目-宠物识别
  15. 我的 FPGA 学习历程(11)—— 实验:按键消抖
  16. Python PEP8 编码规范
  17. 使用TensorFlow训练模型的基本流程【转】
  18. springdata笔记2
  19. JavaSE学习总结(十)—— JDBC与面向对象测试
  20. springmvc概述及框架原理

热门文章

  1. HTTP - 请求头的具体含义
  2. [译]14-spring 集合元素的注入
  3. Oracle 遇到的问题:IMP-00041: 警告: 创建的对象带有编译警告解决办法
  4. HDU 4667 Building Fence 计算几何 凸包+圆
  5. 蓝桥杯_风险度量_dfs_无向图两节点间的所有路径
  6. Android记事本开发04
  7. 【bzoj4756】[Usaco2017 Jan]Promotion Counting 离散化+树状数组
  8. 【bzoj4884】[Lydsy2017年5月月赛]太空猫 dp
  9. Python列表及元组操作
  10. hdu 2579 Dating with girls(2) (bfs)