Variadic commands

This commit is contained in:
ivowiblo
2012-04-18 15:22:43 -04:00
parent e4f7f61d00
commit 8aca0b77f9
10 changed files with 176 additions and 102 deletions

View File

@@ -1,6 +1,8 @@
package redis.clients.util;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import redis.clients.jedis.Protocol;
import redis.clients.jedis.exceptions.JedisDataException;
@@ -11,6 +13,14 @@ import redis.clients.jedis.exceptions.JedisException;
*
*/
public class SafeEncoder {
public static byte[][] encodeMany(final String... strs){
byte[][] many = new byte[strs.length][];
for(int i=0;i<strs.length;i++){
many[i] = encode(strs[i]);
}
return many;
}
public static byte[] encode(final String str) {
try {
if (str == null) {