RawDataBlock expects to read 512 bytes on every read. InputStreams that are not FileInputStream can often return less than 512 bytes on any given read. (e.g. ServletInputStream or ByteArrayInputStream)
Try the workaround in bug 13478. Or try wrapping your stream in a buffered input stream. I think that should help. does it? *** This bug has been marked as a duplicate of 13478 ***