java/KinesisAggregator/src/main/java/com/amazonaws/kinesis/agg/AggRecord.java [408:472]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		} else {
			return null;
		}
	}

	/**
	 * Validate the data portion of an input Kinesis user record.
	 * 
	 * @param data A byte array containing Kinesis user record data.
	 */
	private void validateData(final byte[] data) {
		final int maxAllowableDataLength = MAX_BYTES_PER_RECORD - AGGREGATED_RECORD_MAGIC.length
				- this.md5.getDigestLength();
		if (data != null && data.length > (maxAllowableDataLength)) {
			throw new IllegalArgumentException("Data must be less than or equal to " + maxAllowableDataLength
					+ " bytes in size, got " + data.length + " bytes");
		}
	}

	/**
	 * Validate the partition key of an input Kinesis user record.
	 * 
	 * @param partitionKey The string containing the input partition key to
	 *                     validate.
	 */
	private void validatePartitionKey(final String partitionKey) {
		if (partitionKey == null) {
			throw new IllegalArgumentException("Partition key cannot be null");
		}

		if (partitionKey.getBytes().length < PARTITION_KEY_MIN_LENGTH
				|| partitionKey.getBytes().length > PARTITION_KEY_MAX_LENGTH) {
			throw new IllegalArgumentException(
					"Invalid partition key. Length must be at least " + PARTITION_KEY_MIN_LENGTH + " and at most "
							+ PARTITION_KEY_MAX_LENGTH + ", got length of " + partitionKey.getBytes().length);
		}

		try {
			partitionKey.getBytes(StandardCharsets.UTF_8);
		} catch (Exception e) {
			throw new IllegalArgumentException("Partition key must be valid " + StandardCharsets.UTF_8.displayName());
		}
	}

	/**
	 * Validate the explicit hash key of an input Kinesis user record.
	 * 
	 * @param explicitHashKey The string containing the input explicit hash key to
	 *                        validate.
	 */
	private void validateExplicitHashKey(final String explicitHashKey) {
		if (explicitHashKey == null) {
			return;
		}

		BigInteger b = null;
		try {
			b = new BigInteger(explicitHashKey);
			if (b.compareTo(UINT_128_MAX) > 0 || b.compareTo(BigInteger.ZERO) < 0) {
				throw new IllegalArgumentException(
						"Invalid explicitHashKey, must be greater or equal to zero and less than or equal to (2^128 - 1), got "
								+ explicitHashKey);
			}
		} catch (NumberFormatException e) {
			throw new IllegalArgumentException("Invalid explicitHashKey, must be an integer, got " + explicitHashKey);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



java/KinesisAggregatorV2/src/main/java/com/amazonaws/kinesis/agg/AggRecord.java [402:466]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		} else {
			return null;
		}
	}

	/**
	 * Validate the data portion of an input Kinesis user record.
	 * 
	 * @param data A byte array containing Kinesis user record data.
	 */
	private void validateData(final byte[] data) {
		final int maxAllowableDataLength = MAX_BYTES_PER_RECORD - AGGREGATED_RECORD_MAGIC.length
				- this.md5.getDigestLength();
		if (data != null && data.length > (maxAllowableDataLength)) {
			throw new IllegalArgumentException("Data must be less than or equal to " + maxAllowableDataLength
					+ " bytes in size, got " + data.length + " bytes");
		}
	}

	/**
	 * Validate the partition key of an input Kinesis user record.
	 * 
	 * @param partitionKey The string containing the input partition key to
	 *                     validate.
	 */
	private void validatePartitionKey(final String partitionKey) {
		if (partitionKey == null) {
			throw new IllegalArgumentException("Partition key cannot be null");
		}

		if (partitionKey.getBytes().length < PARTITION_KEY_MIN_LENGTH
				|| partitionKey.getBytes().length > PARTITION_KEY_MAX_LENGTH) {
			throw new IllegalArgumentException(
					"Invalid partition key. Length must be at least " + PARTITION_KEY_MIN_LENGTH + " and at most "
							+ PARTITION_KEY_MAX_LENGTH + ", got length of " + partitionKey.getBytes().length);
		}

		try {
			partitionKey.getBytes(StandardCharsets.UTF_8);
		} catch (Exception e) {
			throw new IllegalArgumentException("Partition key must be valid " + StandardCharsets.UTF_8.displayName());
		}
	}

	/**
	 * Validate the explicit hash key of an input Kinesis user record.
	 * 
	 * @param explicitHashKey The string containing the input explicit hash key to
	 *                        validate.
	 */
	private void validateExplicitHashKey(final String explicitHashKey) {
		if (explicitHashKey == null) {
			return;
		}

		BigInteger b = null;
		try {
			b = new BigInteger(explicitHashKey);
			if (b.compareTo(UINT_128_MAX) > 0 || b.compareTo(BigInteger.ZERO) < 0) {
				throw new IllegalArgumentException(
						"Invalid explicitHashKey, must be greater or equal to zero and less than or equal to (2^128 - 1), got "
								+ explicitHashKey);
			}
		} catch (NumberFormatException e) {
			throw new IllegalArgumentException("Invalid explicitHashKey, must be an integer, got " + explicitHashKey);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



