private JSONObject readJSONObjFromWire ( MessagingChannel messagingChannel ) throws IOException , JSONException { ByteBuffer messageBytes = messagingChannel . readMessage ( ) ; JSONObject jsObj = new JSONObject ( new String ( messageBytes . array ( ) , StandardCharsets . UTF_8 ) ) ; return jsObj ; }
Read a length prefixed JSON message