File transfer from gateway to client scope

In the SDK, I search how to transfert a file read from the gateway to the client scope and write it on the client disk.
RPC feature need serializable data object. I need to transfert wav sound file.

Base64 encode it on the client before sending and then Base64 decode on the gateway when you receive it.

2 Likes

Or just create your own serializable wrapper class:

public class WavBytes implements Serializable {

    private final byte[] wavBytes;

    public WavBytes(byte[] wavBytes) {
        this.wavBytes = wavBytes;
    }

    public byte[] getWavBytes() {
        return wavBytes;
    }
    
}
1 Like

Uhm? Byte arrays are serializable. Just return one from your RPC call. Or send it as the payload of your push notification.

2 Likes

Ha, I assumed sending a byte[] wasn’t working for some reason since he is here asking, but yeah, that would be the first/obvious approach…

Thanks, I will try the RPC with Byte array. Seems to be the more straightforward.
It looked to easy to work.