可以用随机读写类
RandomAccessFile这个类可以操作文件指针,文档上有详细说明

解决方案 »

  1.   

    是可以的,不过是逻辑上实现这样的功能。
    大概写这样的代码吧
    FileOutputStream fout=new FileOutputStream("A", true);
    FileInputStream fin= new FileInputStream("B");
    byte [] b = new byte[fin.available()];
    fin.read(b);
    fout.write(b);
      

  2.   

    我觉得用RandomAccess不错啊。。随便你在哪插入数据
    RandomAccess fa = new RandomAccess(a);
    RandomAccess fb = new RandomAccess(b);
    fa,seek(a.length);
    int i;
    while((i=fb.read())!= -1){
     fa.writer(i);
    }
    当然啦,这是一个字节一个字节,你也可以像楼上的上面样,读字节数组