Blob blob = null;
byte[] content = IOUtils.toByteArray(myinputstream);
try {
blob = new SerialBlob(content);//debugger says content is empty here
someObject.setSomeBlobProperty(blob);//debugger says blob is empty here.
}//debugger says myinputstream has the same values as in edit#1
catch (SerialException e) {e.printStackTrace();}
catch (SQLException e) {e.printStackTrace();}