DataInputStream filein= new DataInputStream(new FileInputStream("file.txt"));
byte b…………具体的定义,你自己查吧。
char ch=(char)filein.read(b,51,1);
…………ch 解码。
filein.close();DataOutputStream fileout = new DataOutputStream(new FileOutputStream("file.txt"));
fileout.write(b,51,1);
fileout.close();呵呵,好多语法细节我也不太记得的了,你随便找本书都会讲有,还有例外处理我还没有写,你自己加上吧。    try {//读写文件。上面一段。}
    catch (IOException _ex) {
      System.out.println("file erorr \n");
    }