count1和count2中保存的是你读到的字节数,读到的真正的数保存在buffer1和buffer2中

解决方案 »

  1.   

    java.io 
    Class InputStreamint read(byte[] b) 
              Reads some number of bytes from the input stream and stores them into the buffer array b Parameters:
    b - the buffer into which the data is read. Returns:
    the total number of bytes read into the buffer, or -1 is there is no more data because the end of the stream has been reached. Throws: 
    IOException - if an I/O error occurs.
      

  2.   

    count1,count2里面存储的是buffer1,buffer2的长度.
      

  3.   

    read
    public int read(byte[] b)
             throws IOException
    ...Returns:
    the total number of bytes read into the buffer, or -1 is there is no more data because the end of the stream has been reached.