My dearest
Java guru,
I'm writing a Java program that suppose to read some (possibly huge) lines
of input from the Window's command prompt using InputStreamReader.
The problem comes if there was a long line of input being read. Suppose
the line consists of 200 characters (including white spaces), but the
command prompt's screen only fits 80 characters per line. My program will
then receive such input in two lines. The first line consists of the most
amount of words possible, while the second line consists of the rest of
the words. If I increase the size of the command prompt window so that it
can holds 200 character, the problem went away.
The question now, is there anyway we can control the buffer size of the
command prompt from Java? I read that BufferedReader constructor can
receive a second parameter (an int) that represents the size of the
buffer. But, I don't think this is what I need to do. Any help/suggestions
will be greatly appreciated.
Regards,
Miguel