×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Karthick Bala
Added: Jul 25, 2014 10:18 AM
Modified: Jul 25, 2014 10:20 AM
Views: 8
Tags: no tags
  1.     public static byte[] getByteValue(JSONObject jsonObj, String key) {
  2.          byte[] stringVal = null;
  3.          byte[] tempStr = jsonObj.optString(key).getBytes();
  4.         if(tempStr != null && tempStr.length > 0) {
  5.             stringVal = tempStr;
  6.         }
  7.         return stringVal;
  8.     }