I am trying to get a JSON response from our server and the response string seems is always being truncated when the string length reaches to around 5525 characters.
It is possible that the server can tell the difference between your browser and your application and is responding differently.
Hack your Java code to print out the request and response headers, and compare them with the headers you get when using your browser.
Also try doing the request using curl and/or wget from the command line. These give you a lot more information, plus the ability to set request headers.