Results 1 to 3 of 3
  1. #1
    Godjikung is offline Member
    Join Date
    Jan 2011
    Posts
    3
    Rep Power
    0

    Default OutputStream.flush() problem

    I would like to send the same command multiple times to cmd. My source code is here:

    Java Code:
    Process process = Runtime.getRuntime ().exec ("cmd");
    
    for(int i=0;i<=250;i++)
    {
          line="command"+"\n";
          stdin.write(line.getBytes());
          stdin.flush();
          System.out.println(i);
    }stdin.close();
    My program didn't complete the loop. It works about 200times and hang without any error message. Help me please

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,455
    Rep Power
    20

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. GZIPOutputstream flush
    By Nardian in forum Networking
    Replies: 4
    Last Post: 09-25-2010, 06:09 PM
  2. How to flush gui from using old data
    By ShinTec in forum AWT / Swing
    Replies: 1
    Last Post: 06-10-2010, 03:18 PM
  3. Outputstream not streaming.
    By dantestein in forum Networking
    Replies: 2
    Last Post: 03-14-2009, 08:36 AM
  4. interrupting urlconnection's outputstream
    By zynasis in forum Networking
    Replies: 5
    Last Post: 10-02-2008, 01:49 AM
  5. flush method
    By bugger in forum New To Java
    Replies: 0
    Last Post: 11-11-2007, 08:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •