0

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!

miibpa
  • 235
  • 1
  • 4
  • 15
  • Seems similar to https://stackoverflow.com/questions/36814346/okhttp-stream-request-to-server#43406143 – Jesse Wilson Nov 30 '17 at 12:20
  • It's similar, but in my case I'd like to send bytes while I receive them in onAudioData, not after finishing recording. – miibpa Nov 30 '17 at 12:41

0 Answers0