How are you verifying that:
all of the jpg bytes are transfered
?
Are you sure that you are always treating the contents as byte[]? As Nisha said, check your use of streams - watch out for treating the bytes as characters, for example by creating a
String or using a Writer or Reader.
Due to unicode character conversions, an image will not survive being treated as char[] or String.
Bill