I am using buffered reader coupled with inputstream reading from a socket.i use following code to read the message from the bufferedreader.

char[] buff = new char[msgLength]; is.read(buff, 0, msgLength);

it works in most of the cases , but fails when being used with firewall which divides the message into packets. if i change the code to read it line by line, it solves the issue, but that degardes the performance.whats the ideal solution? should i just remove the buffered reader and read it from the input stream directly?