PipedOutputStream不是缓冲区,可以抽象成一个传输数据的管道。只传递int类型,应该是为了过滤,只输出和接收int类型的数据。但是好象read和write方法应该用readInt和writeInt.

解决方案 »

  1.   

    public void write(int b)
               throws IOException Writes the specified byte to the piped output stream. If a thread was reading data bytes from the connected piped input stream, but the thread is no longer alive, then an IOException is thrown. Implements the write method of OutputStream.Overrides:
         write in class OutputStream Parameters:
          b - the byte to be written.
                  ^^^^Throws:IOException - if an I/O error occurs.
      

  2.   

    colin1022(暗夜要爪哇)
    不是接收int型的数据,这个程序是把文件String file串包含的文件名的文件内容传过去。