BaseToSObj sysBean = DataUtil.getSysBean(); //转字节数组 byte[] bytes = new Gson().toJson(sysBean).getBytes(); String s = Arrays.toString(bytes); LogUtil.d("s:"+ s); //字节数组转字符串 LogUtil.d("json:"+ new String(bytes, StandardCharsets.UTF_8));
BaseToSObj sysBean = DataUtil.getSysBean(); //转字节数组 byte[] bytes = new Gson().toJson(sysBean).getBytes(); String s = Arrays.toString(bytes); LogUtil.d("s:"+ s); //字节数组转字符串 LogUtil.d("json:"+ new String(bytes, StandardCharsets.UTF_8));