zset
public void zadd(final byte[] key, final double score, final byte[] member) {
sendCommand(ZADD, key, toByteArray(score), member);
}
并且被提交的 bytes 都是被utf-8编码的
Client extends BinaryClient:
public void zadd(final String key, final double score, final String member) {
zadd(SafeEncoder.encode(key), score, SafeEncoder.encode(member));
}
SafeEncoder:
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);
}
}
Protocol:
public static final String CHARSET = "UTF-8";
``