The code below does not work as I expect it to. The entire stream(request) content is not read into the array. The len and the len2 differ in size and the ba when printed displays only the first part of the text in the request, then blanks until len is reached. Does anyone have an idea what might be the problem? The problem occurs with lengts around 1000 bytes and larger. About half is cut off.
doPost(HttpServletRequest req, HttpServletResponse res)
{
int len = req.getContentLength();
InputStream is = req.getInputStream();
byte[] ba = new byte[8192];
int len2 = is.read(ba, 0, len);
}