public static JSONObject toJsonObject ( byte [ ] bytes ) { String json ; try { json = new String ( bytes , Const . UTF8 ) ; return new JSONObject ( json ) ; } catch ( UnsupportedEncodingException e ) { throw new WebbException ( e ) ; } catch ( JSONException e ) { throw new WebbException ( "payload is not a valid JSON object" , e ) ; } }
Convert a byte array to a JSONObject .