public void select(int dbIndex) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.select(dbIndex));
     }
     client.select(dbIndex);
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Set<byte[]> keys(byte[] pattern) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.keys(pattern));
       return null;
     }
     return SrpUtils.toSet(client.keys(pattern).data());
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public byte[] rPop(byte[] key) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.rpop(key));
       return null;
     }
     return client.rpop(key).data();
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public void lSet(byte[] key, long index, byte[] value) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.lset(key, index, value));
       return;
     }
     client.lset(key, index, value);
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public List<byte[]> lRange(byte[] key, long start, long end) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.lrange(key, start, end));
       return null;
     }
     return SrpUtils.toBytesList(client.lrange(key, start, end).data());
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public byte[] lIndex(byte[] key, long index) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.lindex(key, index));
       return null;
     }
     return client.lindex(key, index).data();
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Long strLen(byte[] key) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.strlen(key));
       return null;
     }
     return client.strlen(key).data();
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public void setBit(byte[] key, long offset, boolean value) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.setbit(key, offset, SrpUtils.asBit(value)));
       return;
     }
     client.setbit(key, offset, SrpUtils.asBit(value));
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public DataType type(byte[] key) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.type(key));
       return null;
     }
     return DataType.fromCode(client.type(key).data());
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public void rename(byte[] oldName, byte[] newName) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.rename(oldName, newName));
       return;
     }
     client.rename(oldName, newName);
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Boolean renameNX(byte[] oldName, byte[] newName) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.renamenx(oldName, newName));
       return null;
     }
     return (client.renamenx(oldName, newName).data() == 1);
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public byte[] randomKey() {
   try {
     if (isPipelined()) {
       pipeline(pipeline.randomkey());
       return null;
     }
     return client.randomkey().data();
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Boolean move(byte[] key, int dbIndex) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.move(key, dbIndex));
       return null;
     }
     return client.move(key, dbIndex).data() == 1;
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Boolean persist(byte[] key) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.persist(key));
       return null;
     }
     return client.persist(key).data() == 1;
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Long incrBy(byte[] key, long value) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.incrby(key, value));
       return null;
     }
     return client.incrby(key, value).data();
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public void unwatch() {
   try {
     if (isPipelined()) {
       pipeline(pipeline.unwatch());
       return;
     }
     client.unwatch();
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Boolean getBit(byte[] key, long offset) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.getbit(key, offset));
       return null;
     }
     return (client.getbit(key, offset).data() == 1);
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Long append(byte[] key, byte[] value) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.append(key, value));
       return null;
     }
     return client.append(key, value).data();
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public void setRange(byte[] key, byte[] value, long start) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.setrange(key, start, value));
       return;
     }
     client.setrange(key, start, value);
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public List<byte[]> mGet(byte[]... keys) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.mget((Object[]) keys));
       return null;
     }
     return SrpUtils.toBytesList(client.mget((Object[]) keys).data());
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Long rPush(byte[] key, byte[] value) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.rpush(key, new Object[] {value}));
       return null;
     }
     return client.rpush(key, new Object[] {value}).data();
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public void mSetNX(Map<byte[], byte[]> tuples) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.msetnx((Object[]) SrpUtils.convert(tuples)));
       return;
     }
     client.msetnx((Object[]) SrpUtils.convert(tuples));
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Long lInsert(byte[] key, Position where, byte[] pivot, byte[] value) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.linsert(key, SrpUtils.convertPosition(where), pivot, value));
       return null;
     }
     return client.linsert(key, SrpUtils.convertPosition(where), pivot, value).data();
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public void setEx(byte[] key, long time, byte[] value) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.setex(key, time, value));
       return;
     }
     client.setex(key, time, value);
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Long lRem(byte[] key, long count, byte[] value) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.lrem(key, count, value));
       return null;
     }
     return client.lrem(key, count, value).data();
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Boolean setNX(byte[] key, byte[] value) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.setnx(key, value));
       return null;
     }
     return client.setnx(key, value).data() == 1;
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public void lTrim(byte[] key, long start, long end) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.ltrim(key, start, end));
       return;
     }
     client.ltrim(key, start, end);
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public byte[] getRange(byte[] key, long start, long end) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.getrange(key, start, end));
       return null;
     }
     return client.getrange(key, start, end).data();
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.rpoplpush(srcKey, dstKey));
       return null;
     }
     return client.rpoplpush(srcKey, dstKey).data();
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }
 public Boolean expireAt(byte[] key, long unixTime) {
   try {
     if (isPipelined()) {
       pipeline(pipeline.expireat(key, unixTime));
       return null;
     }
     return client.expireat(key, unixTime).data() == 1;
   } catch (Exception ex) {
     throw convertSrpAccessException(ex);
   }
 }