Line break while reading bulk String using DataInputStream's read()
Hi All,
I am writing a TCP socket client which connects to the server and issues a command ( i.e., writes onto the socket using DataOutputStream's write() ) and in return gets back few pages of output which i will be reading using DataInputStream's read(). The problem is after reading few lines randomly one of the line breaks into two because of which the regular expression cannot match this line.
Hence , i would like to know if there is any know issue w.r.t reading bulk string which consists of few hundreds of lines.
The following is the code :
private DataInputStream dis = null;
private DataOutputStream dos = null;
dos.write(new String(mmlCommand).getBytes());
byte[] byteArray = new byte[8192];
while((dis.read(byteArray)) != -1 ) {
Result = new String(byteArray);
...
...
}
When i print the Result i see that 20th line which the server is sending is breaks into 2 lines.
I am struck !! Looking forward for help !
regards
Chandra

