相关文章推荐
慷慨大方的显示器  ·  Oracle函数 – ...·  1 周前    · 
任性的菠菜  ·  Python - ...·  2 月前    · 
高大的白开水  ·  Java ...·  12 月前    · 
* @param fileName 文件路径 public static void beiju(long skip, String str, String fileName){ try { RandomAccessFile raf = new RandomAccessFile(fileName,"rw"); if(skip < 0 || skip > raf.length()){ System.out.println("跳过字节数无效"); return; byte[] b = str.getBytes(); raf.setLength(raf.length() + b.length); for(long i = raf.length() - 1; i > b.length + skip - 1; i--){ raf.seek(i - b.length); byte temp = raf.readByte(); raf.seek(i); raf.writeByte(temp); raf.seek(skip); raf.write(b); raf.close(); } catch (Exception e) { e.printStackTrace(); } from: http://blog.csdn.net/akon_vm/article/details/7429245 评论 ( 2 )