image is the string of an image file .
I have code as follows in C#:
Convert.ToBase64String(image);
and code as follows in
First you need to realise that a byte stores 256 values whether its signed or unsigned. If you want to get unsigned values from a signed byte (which is what Java supports) you can use & 0xFF
e.g.
byte[] bytes = { 0, 127, -128, -1};
for(byte b: bytes) {
int unsigned = b & 0xFF;
System.out.println(unsigned);
}
prints
0
127
128
255
The simple answer is you don't need a byte[] which has the same values. ;)