}
public static byte[] encode(final String str) {
try {
if (str == null) {
throw new JedisDataException(
"value sent to redis cannot be null");
}
return str.getBytes(Protocol.CHARSET);
} catch (UnsupportedEncodingException e) {
throw new JedisException(e);