How to use OkIo Buffer as RequestBody in Okhttp

89 Views Asked by At

I'm developing anAndroid SDK and i have to send a post request with raw audio bytes from mic as being generated, I'm currently witting bytes into an OkIo Buffer like this

public void onAudioData(byte[] data, int size) {

        buffer.write(data);

    }
}

How could use this buffer as RequestBody with okHttp? Is there any better solution?

Thank you in advance!

0

There are 0 best solutions below