I created an Object which is sent through Google Cloud Endpoints. Among its parameters there is one parameter of type byte[] with its getter and setter methods.
The problem is when I want to set the byte[] parameter in my app it expects somehow a parameter of type String? Does it want me to encode the byte array or what is the reason for that strange error?
When I get the parameter from the dataObject it is of type byte[] and everything is fine. I am really confused!
My Object is DataPackage defined in my Backend
...
private byte[] imageThumbnail;
public void setImageThumbnail(byte[] imageThumbnail) {
this.imageThumbnail = imageThumbnail;
}
public byte[] getImageThumbnail() {
return imageThumbnail;
}
Then in my app I try to set the imageByteArray
dataPackage.setImageThumbnail(byteThumbnail); // gives error that String is expected
And this works fine
dataPackage.getImageThumbnail() // is of type byte[]