Request_content bytes or inputstream not working

Hi,

We are trying to send files from a servlet and get them from request_content field as either a byte array or a inputStream, however whatever we do we get fewer bytes and our files are corrupted.

We are using files under 64K to avoid those known issues.

We either use this command…

byte bytePost = doc.getItemValueCustomDataBytes(“REQUEST_CONTENT”,null);

or

					Item reqItem = doc.getFirstItem("REQUEST_CONTENT");

					InputStream is = reqItem.getInputStream();

					System.out.println("--- inputStream Bytes ---" + is.available());

					is.read(bytePost, 0, bytePost.length);

Using both methods we loose bytes. The Content_Length says the content should be 8436 Bytes but the inputStream is 8024???

Does anybody have any idea why this is happening? Can we not send binary data through the request_content field?

Any answers or suggestions gratefully accepted.

regards

Deborah