public class JSONParaser {
        //将Bean转成JSON
public static JSONObject getJSON(Object content){
try{
JSONObject result = JSONObject.fromObject(content);
return result;
}
catch(Exception ex){
return null;
}
}

        //JSON字符串转成Bean
public static Object getString(String json){
try{
JSONObject jobj=JSONObject.fromObject(json);
return JSONObject.toBean(jobj);
}
catch(Exception ex){
return null;
}
}
}
如上代码,SOCKET发送JSON数据时的代码是怎么个写法?是要把获取的JSON对象转成string 再以byte[] 的方式发出去么?