From f8ae9e15d68987fbb86e7683c47ee73758782eaf Mon Sep 17 00:00:00 2001 From: olyanren Date: Sun, 13 Nov 2022 08:59:37 +0300 Subject: [PATCH] Little Endian Issue We shoud set ByteBuffer order as LITTLE_ENDIAN at both side which are sending and receiving --- .../antmedia/webrtc_android_sample_app/DataChannelActivity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/webrtc-android-sample-app/src/main/java/io/antmedia/webrtc_android_sample_app/DataChannelActivity.java b/webrtc-android-sample-app/src/main/java/io/antmedia/webrtc_android_sample_app/DataChannelActivity.java index c9e9d99c..3012ff31 100644 --- a/webrtc-android-sample-app/src/main/java/io/antmedia/webrtc_android_sample_app/DataChannelActivity.java +++ b/webrtc-android-sample-app/src/main/java/io/antmedia/webrtc_android_sample_app/DataChannelActivity.java @@ -546,6 +546,7 @@ void sendFirstChunk(String messageHeader) { // put length how much data will be sent in total ByteBuffer imageChunkData = ByteBuffer.allocate(totalMessageHeaderLength+endChunk); + imageChunkData.order(ByteOrder.LITTLE_ENDIAN); imageChunkData.putInt(dataBytes.length); imageChunkData.putInt(header.length); imageChunkData.put(messageHeaderBytes);