当前位置: 技术问答>java相关
关于管道流的问题,在线等待
来源: 互联网 发布时间:2015-09-02
本文导语: 我有两个线程需要传递数据,我用了一对管道输入输出流来实现,并将其转化为对象输入输出流来进行实际的读写。因为需要读出不确定个数的对象,在管道出口一端我用一个死循环从管道读取对象直到EOFException,当...
我有两个线程需要传递数据,我用了一对管道输入输出流来实现,并将其转化为对象输入输出流来进行实际的读写。因为需要读出不确定个数的对象,在管道出口一端我用一个死循环从管道读取对象直到EOFException,当管道入口一端连续写入若干对象然后关闭输出流时,一切正常,但我这一端是需要多个线程先后向管道写入对象的,经调试发现好象在第一个线程结束后,管道输出端在read时就会产生IOException:Write end dead,请问这是什么回事?
|
帮你查了些资料,我就不给你翻译了(怕引起误解)
Inner classes ,unless static ,have an implicit reference to the enclosing instance.The enclosing instance must be provided to the new call that constructs the inner class.In many cases , inner classes are constructed inside instance methods of the enclosing class . in which case this.new is implied by new.
Inner classes have access to the variables of the enclosing class instance . Static inner classes can only access the static members of the enclosing class.Also,inner classes defined in the methos scope have read access to final variables of the enclosing scope.
Inner classes ,unless static ,have an implicit reference to the enclosing instance.The enclosing instance must be provided to the new call that constructs the inner class.In many cases , inner classes are constructed inside instance methods of the enclosing class . in which case this.new is implied by new.
Inner classes have access to the variables of the enclosing class instance . Static inner classes can only access the static members of the enclosing class.Also,inner classes defined in the methos scope have read access to final variables of the enclosing scope.
|
每个线程都关闭管道吗?
|
sorry 回错地方了
|
你吧代码贴出来大家研究把。
|
up
|
uppppp
|
关注
|
up