Editing of user picture implemented

I had major problems here :D. In the database the image is stored as
varbinary(MAX) which is actually a C# byte array. The problem is that
the Java byte != C# byte. The C# byte is unsigned [0, 255]. The Java
byte is signed [-128, 127]. When I was converting the picture from
Bitmap to byte array in the client, the array in Java had some negative
values (e.g. [ -50, 2 ,17... ]. When I send this byte array to the
server, the json deserializator can't turn a byte array with negative
values to byte array with only positive values. What I did is to add 128
to all of the values and save this byte array in short array and send
that short array to the server. That way I am sending an array with only
unsigned bytes and the deserialization of the json is made successfully.
There was another problem after that. When I get the photo from the
database, the web-api actually sends the byte array as Base64 encoded
string because the traffic is less. I was able to decode it to byte
array (Java byte array - with negative values), but that wasn't the
actual byte array from the server and the image was broken. Then i
though that if the server sends a byte with value 128 for example, that
is actually -127 in the java byte, because it overflows. All I had to do
here is to subtract 128 from byte array in java (to overflow it in the
other direction). This way the picture was not broken.