楼主可以用ObjectFileWriter或者DataOutputStream。。这两种类里面提供不同得数据写入和写出的功能。。你看一下帮助文档就明白我的意思了。。

解决方案 »

  1.   

    java.io 
    Class DataInputStream
    java.lang.Object
      |
      +--java.io.InputStream
            |
            +--java.io.FilterInputStream
                  |
                  +--java.io.DataInputStreamAll Implemented Interfaces: 
    DataInput int read(byte[] b) 
              Reads some number of bytes from the contained input stream and stores them into the buffer array b. 
     int read(byte[] b, int off, int len) 
              Reads up to len bytes of data from the contained input stream into an array of bytes. 
     boolean readBoolean() 
              See the general contract of the readBoolean method of DataInput. 
     byte readByte() 
              See the general contract of the readByte method of DataInput. 
     char readChar() 
              See the general contract of the readChar method of DataInput. 
     double readDouble() 
              See the general contract of the readDouble method of DataInput. 
     float readFloat() 
              See the general contract of the readFloat method of DataInput. 
     void readFully(byte[] b) 
              See the general contract of the readFully method of DataInput. 
     void readFully(byte[] b, int off, int len) 
              See the general contract of the readFully method of DataInput. 
     int readInt() 
              See the general contract of the readInt method of DataInput. 
    ...