检查给定 key 是否存在。

@param keyBytes
@return
547426
public boolean exists() {
		try {
			if(!isBinary)return getJedisCommands(groupName).exists(key);
			if(isCluster(groupName)){
				return getBinaryJedisClusterCommands(groupName).exists(keyBytes);
			}
			return getBinaryJedisCommands(groupName).exists(keyBytes);
		} finally {
			getJedisProvider(groupName).release();
		}
		
	}
1034170
public static byte[] readKeyBytes(InputStream keyStream) {
		PemObject pemObject = readPemObject(keyStream);
		if (null != pemObject) {
			return pemObject.getContent();
		}
		return null;
	}
57878
@Override
  public TaskKey fromBytes(byte[] bytes) {
    byte[][] keyComponents = JobKeyConverter.splitJobKey(bytes);
    JobKey jobKey = jobKeyConv.parseJobKey(keyComponents);
    return new TaskKey(jobKey,
        (keyComponents.length > 5 ? Bytes.toString(keyComponents[5]) : null));
  }
1228030
public byte getByte(final String key) {
		final String value = getProperty(key);
		if (value == null) {
			throw new NumberFormatException("Couldn't parse property to byte.");
		}
		return Byte.parseByte(value);
	}
342849
public KeyedStream<T, Tuple> keyBy(int... fields) {
		if (getType() instanceof BasicArrayTypeInfo || getType() instanceof PrimitiveArrayTypeInfo) {
			return keyBy(KeySelectorUtil.getSelectorForArray(fields, getType()));
		} else {
			return keyBy(new Keys.ExpressionKeys<>(fields, getType()));
		}
	}
81401
public static SecretKey generateKey(final byte[] key) {
        return new SecretKey() {

            private byte[] k;

            {
                if (key.length == 16) {
                    k = key;
                } else {
                    k = new byte[16];
                    System.arraycopy(key, 0, k, 0, key.length < 16 ? key.length : 16);
                }
            }

            @Override
            public String getAlgorithm() {
                return "AES";
            }

            @Override
            public String getFormat() {
                return "RAW";
            }

            @Override
            public byte[] getEncoded() {
                return k;
            }
        };
    }
1365401
private byte[] getByteKey(K key){
		if(key instanceof String){
			String preKey = this.keyPrefix + key;
    		return preKey.getBytes();
    	}else{
    		return SerializeUtils.serialize(key);
    	}
	}
1365194
public Long del(Object... keys) {
		Jedis jedis = getJedis();
		try {
			return jedis.del(keysToBytesArray(keys));
		}
		finally {close(jedis);}
	}
16381
private static byte[] applyCipher(byte[] keyBytes, byte[] textBytes) {
        byte[] result = new byte[textBytes.length];
        for (int i = 0; i < result.length; i++) {
            int keyPos = i % keyBytes.length;
            result[i] = (byte) (textBytes[i] ^ keyBytes[keyPos]);
        }
        return result;
    }
456307
public byte[] decrypt(byte[] cipherBytes) throws MissingParameterException {
		if (cipherBytes == null || cipherBytes.length == 0) {
			throw new MissingParameterException("Missing parameter: cipherBytes");
		}

		return byteEncryptor.decrypt(cipherBytes);

	}
783461
public String fromByteArray(byte[] bytes) {
    java.util.Objects.requireNonNull(bytes, "bytes");
    return fromByteArray(bytes, 0, bytes.length);
  }
557557
public byte[] set(byte[] key,byte[] value){
		Jedis jedis = jedisPool.getResource();
		try{
			jedis.set(key,value);
			if(this.expire != 0){
				jedis.expire(key, this.expire);
		 	}
		}finally{
			jedisPool.returnResource(jedis);
		}
		return value;
	}
1144374
public static byte[] passwordBytes(AbstractConfig config, String key) {
    return passwordBytes(config, key, Charsets.UTF_8);
  }
1050679
private String encodeKeysGet(String keys) {
        try {
            return URLEncoder.encode(keys, "UTF-8");
        } catch(Exception ex) {
            throw new RuntimeException("Could not prepare view argument: " + ex);
        }
    }
1017418
public PrivateKey getPrivateKey_PKCS8Encoded(byte[] keyBytes){  
        try {
            PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(keyBytes);  
            KeyFactory keyFactory = KeyFactory.getInstance(algorithm);  
            return keyFactory.generatePrivate(spec); 
		} catch (Exception e) {
			log.error(e.getMessage(),e);
		} 
    	return null;
    }
422701
public byte[] get(byte[] key)
      throws IOException {
    int keyLength = key.length;
    if (keyLength >= slots.length || keyCounts[keyLength] == 0) {
      return null;
    }
    long hash = (long) hashUtils.hash(key);
    int numSlots = slots[keyLength];
    int slotSize = slotSizes[keyLength];
    int indexOffset = indexOffsets[keyLength];
    long dataOffset = dataOffsets[keyLength];

    for (int probe = 0; probe < numSlots; probe++) {
      int slot = (int) ((hash + probe) % numSlots);
      indexBuffer.position(indexOffset + slot * slotSize);
      indexBuffer.get(slotBuffer, 0, slotSize);

      long offset = LongPacker.unpackLong(slotBuffer, keyLength);
      if (offset == 0) {
        return null;
      }
      if (isKey(slotBuffer, key)) {
        byte[] value = mMapData ? getMMapBytes(dataOffset + offset) : getDiskBytes(dataOffset + offset);
        return value;
      }
    }
    return null;
  }
764912
public Byte getAsByte(String key) {
        Object value = mValues.get(key);
        try {
            return value != null ? ((Number) value).byteValue() : null;
        } catch (ClassCastException e) {
            if (value instanceof CharSequence) {
                try {
                    return Byte.valueOf(value.toString());
                } catch (NumberFormatException e2) {
                    logger.severe("Cannot parse Byte value for " + value + " at key " + key);
                    return null;
                }
            } else {
                logger.log(Level.SEVERE, "Cannot cast value for " + key + " to a Byte: " + value, e);
                return null;
            }
        }
    }