Home > Back-end >  Turn the OutputStream to Stream Closed error
Turn the OutputStream to Stream Closed error

Time:09-16

I use a OutputStreamWriter and its modified class OutputStreamWriter BufferedWriter captured the Process, but will run the second time to Java. IO. IOException: Stream Closed error, this kind of error is close to modify first online class close OutputStreamWriter again, according to this method I tried, will report the error
The wrong part of the code:
 
String CMD=Input. The getText ();
The Output. AppendText (CMD);
OutputStreamWriter OSW=new OutputStreamWriter (StartServer getOutputStream ());
BufferedWriter Writer=new BufferedWriter (OSW);
Writer. Write (CMD);
Writer. The close ();
OSW. Close

Error message:
Java. IO. IOException: Stream Closed
The at Java. IO. FileOutputStream. WriteBytes (Native Method)
The at Java. IO. FileOutputStream. Write (FileOutputStream. Java: 326)
The at Java. IO. BufferedOutputStream. FlushBuffer (BufferedOutputStream. Java: 82)
The at Java. IO. BufferedOutputStream. Flush (BufferedOutputStream. Java: 140)
The at Java. IO. FilterOutputStream. Close (FilterOutputStream. Java: 158)
At sun. Nio. Cs. StreamEncoder. ImplClose (StreamEncoder. Java: 320)
At sun. Nio. Cs. StreamEncoder. Close (StreamEncoder. Java: 149)
The at Java. IO. OutputStreamWriter. Close (OutputStreamWriter. Java: 233)
The at xyz. Shandiankulishe. Msm_UI. RunServer then executes $1. Handle (73). RunServer then executes Java:
The at xyz. Shandiankulishe. Msm_UI. RunServer then executes $1. Handle (61). RunServer then executes Java:
At com.sun.javafx.event.Com positeEventHandler. DispatchBubblingEvent (CompositeEventHandler. Java: 86)
At com. Sun. Deployment headaches. Event. EventHandlerManager. DispatchBubblingEvent (EventHandlerManager. Java: 238)
At com. Sun. Deployment headaches. Event. EventHandlerManager. DispatchBubblingEvent (EventHandlerManager. Java: 191)
At com.sun.javafx.event.Com positeEventDispatcher. DispatchBubblingEvent (CompositeEventDispatcher. Java: 59)
At com. Sun. Deployment headaches. Event. BasicEventDispatcher. DispatchEvent (58) BasicEventDispatcher. Java:
At com. Sun. Deployment headaches. Event. EventDispatchChainImpl. DispatchEvent (EventDispatchChainImpl. Java: 114)
At com. Sun. Deployment headaches. Event. BasicEventDispatcher. DispatchEvent (BasicEventDispatcher. Java: 56)
At com. Sun. Deployment headaches. Event. EventDispatchChainImpl. DispatchEvent (EventDispatchChainImpl. Java: 114)
At com. Sun. Deployment headaches. Event. BasicEventDispatcher. DispatchEvent (BasicEventDispatcher. Java: 56)
At com. Sun. Deployment headaches. Event. EventDispatchChainImpl. DispatchEvent (EventDispatchChainImpl. Java: 114)
At com. Sun. Deployment headaches. Event. EventUtil. FireEventImpl (EventUtil. Java: 74)
At com. Sun. Deployment headaches. Event. EventUtil. FireEvent (49) EventUtil. Java:
At deployment headaches. Event. The event. The fireEvent (198) event. Java:
At deployment headaches. Scene. The Node. The fireEvent (8411) Node. Java:
At deployment headaches. Scene. Control. The Button. The fire (185) Button. Java:
At com. Sun. Deployment headaches. Scene. Control. Behaviors. ButtonBehavior. MouseReleased (ButtonBehavior. Java: 182)
At com. Sun. Deployment headaches. Scene. Control. Skin. BehaviorSkinBase $1. Handle (BehaviorSkinBase. Java: 96)
At com. Sun. Deployment headaches. Scene. Control. Skin. BehaviorSkinBase $1. Handle (BehaviorSkinBase. Java: 89)
At com.sun.javafx.event.Com positeEventHandler $NormalEventHandlerRecord. HandleBubblingEvent (CompositeEventHandler. Java: 218)
At com.sun.javafx.event.Com positeEventHandler. DispatchBubblingEvent (CompositeEventHandler. Java: 80)
At com. Sun. Deployment headaches. Event. EventHandlerManager. DispatchBubblingEvent (EventHandlerManager. Java: 238)
At com. Sun. Deployment headaches. Event. EventHandlerManager. DispatchBubblingEvent (EventHandlerManager. Java: 191)
At com.sun.javafx.event.Com positeEventDispatcher. DispatchBubblingEvent (CompositeEventDispatcher. Java: 59)
At com. Sun. Deployment headaches. Event. BasicEventDispatcher. DispatchEvent (58) BasicEventDispatcher. Java:
At com. Sun. Deployment headaches. Event. EventDispatchChainImpl. DispatchEvent (EventDispatchChainImpl. Java: 114)
At com. Sun. Deployment headaches. Event. BasicEventDispatcher. DispatchEvent (BasicEventDispatcher. Java: 56)
At com. Sun. Deployment headaches. Event. EventDispatchChainImpl. DispatchEvent (EventDispatchChainImpl. Java: 114)
At com. Sun. Deployment headaches. Event. BasicEventDispatcher. DispatchEvent (BasicEventDispatcher. Java: 56)
At com. Sun. Deployment headaches. Event. EventDispatchChainImpl. DispatchEvent (EventDispatchChainImpl. Java: 114)
At com. Sun. Deployment headaches. Event. EventUtil. FireEventImpl (EventUtil. Java: 74)
At com. Sun. Deployment headaches. Event. EventUtil. FireEvent (EventUtil. Java: 54)
At deployment headaches. Event. The event. The fireEvent (198) event. Java:
At deployment headaches. The scene. The scene $MouseHandler. Process (3757) scene. Java:
At deployment headaches. Scene. The scene $MouseHandler. Access the $1500 (3485) scene. Java:
At deployment headaches. Scene. The scene. Impl_processMouseEvent (1762) scene. Java:
At deployment headaches. The scene. The scene $ScenePeerListener. MouseEvent (2494) scene. Java:
At com. Sun. Deployment headaches. Tk. Quantum. GlassViewEventHandler $MouseEventNotification. Run (394) GlassViewEventHandler. Java:
At com. Sun. Deployment headaches. Tk. Quantum. GlassViewEventHandler $MouseEventNotification. Run (295) GlassViewEventHandler. Java:
The at Java. Security. The AccessController. DoPrivileged (Native Method)
At com. Sun. Deployment headaches. Tk. Quantum. GlassViewEventHandler. Lambda $handleMouseEvent $2 (432) GlassViewEventHandler. Java:
At com. Sun. Deployment headaches. Tk. Quantum. QuantumToolkit. RunWithoutRenderLock (QuantumToolkit. Java: 410)
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related