public static final byte[] castToBytes(Object value) {
        if (value instanceof byte[]) {
            return (byte[]) value;
        }

        if (value instanceof String) {
            return Base64.decodeFast((String) value);
        }
        throw new JSONException("can not cast to int, value : " + value);
    }
from fastjson
@author Robert HG (254963746@qq.com) on 11/21/15.
lts-core/src/main/java/com/github/ltsopensource/core/json/TypeUtils.java