title: convert JSON Type to Byte array format in java
body: <p>I have a problem when I want to sending data using byte format in UDP protocol, the problem is when I try to create a data with type json object, I can't get the byte format of my data this is my sample code:</p>
  
  <pre><code>    JSONObject obj = new JSONObject();
      obj.put("name", "foo");
      obj.put("num", new Integer(100));
      obj.put("balance", new Double(1000.21));
      obj.put("is_vip", new Boolean(true));
      obj.put("nickname",null);
  
      sendData = obj.getBytes(); //this is error because not have methos getBytes();
  </code></pre>
  
  <p>i know my problem but i can't found how to convert json object to byte, any suggestion ? </p>