file_文件
FileInputStream reader = new FileInputStream(file_);
int size = (new Long(file_.length())).intValue(); 
filedata_ = new byte[size];
reader.read(filedata_);
reader.close(); 最基本的写法,读入字节

解决方案 »

  1.   

    读文件
    String modpath="c:\\b.txt";
    RandomAccessFile fin=new RandomAccessFile(modpath,"r");
    String rLine;
    long filePointer=0;
    long length=fin.length();
    while(filePointer<length)
    {
       rLine=fin.readLine();
       System.out.println(rLine);
       filePointer=fin.getFilePointer();
     }
    fin.close();写文件
    String fullPath="c:\\b.txt";
    tmpContent="Pinch me";
    RandomAccessFile fout=new RandomAccessFile(fullPath,"rw");
    fout.writeBytes(tmpContent);
    fout.close();
      

  2.   

    方法很多。基本上就是灵活运用java。io这个包其实,我推荐能使用RandomAccessFile 是最好的。 将“流氓无赖”测试到底
    ——始于2003年7月
    树欲止而风不停,行云流水匆匆去;
    树梢蚂蚱凭空望,江边浪花碎巨石; 支持“流金岁月”!!!
    发送框,少个“右键菜单,选择粘贴”;
    ——2003年12月24日am^@^