/** * Tests a given byte array to see if it contains only valid characters within the Base64 alphabet. Currently the * method treats whitespace as valid. * * @param arrayOctet byte array to test * @return {@code true} if all bytes are valid characters in the Base64 alphabet or if the byte array is empty; * {@code false}, otherwise * @deprecated 1.5 Use {@link #isBase64(byte[])}, will be removed in 2.0. */ @Deprecated public static boolean isArrayByteBase64(final byte[] arrayOctet) { return isBase64(arrayOctet); }
/** * Tests a given byte array to see if it contains only valid characters within the Base64 alphabet. Currently the * method treats whitespace as valid. * * @param arrayOctet byte array to test * @return {@code true} if all bytes are valid characters in the Base64 alphabet or if the byte array is empty; * {@code false}, otherwise * @deprecated 1.5 Use {@link #isBase64(byte[])}, will be removed in 2.0. */ @Deprecated public static boolean isArrayByteBase64(final byte[] arrayOctet) { return isBase64(arrayOctet); }
/** * Tests a given String to see if it contains only valid characters within the Base64 alphabet. Currently the * method treats whitespace as valid. * * @param base64 String to test * @return {@code true} if all characters in the String are valid characters in the Base64 alphabet or if * the String is empty; {@code false}, otherwise * @since 1.5 */ public static boolean isBase64(final String base64) { return isBase64(StringUtils.utf8(base64)); }
/** * Tests a given String to see if it contains only valid characters within the Base64 alphabet. Currently the * method treats whitespace as valid. * * @param base64 String to test * @return {@code true} if all characters in the String are valid characters in the Base64 alphabet or if * the String is empty; {@code false}, otherwise * @since 1.5 */ public static boolean isBase64(final String base64) { return isBase64(StringUtils.utf8(base64)); }
/** * Tests a given byte array to see if it contains only valid characters within the Base64 alphabet. Currently the * method treats whitespace as valid. * * @param arrayOctet byte array to test * @return {@code true} if all bytes are valid characters in the Base64 alphabet or if the byte array is empty; * {@code false}, otherwise * @since 1.5 */ public static boolean isBase64(final byte[] arrayOctet) { for (int i = 0; i < arrayOctet.length; i++) { if (!isBase64(arrayOctet[i]) && !isWhiteSpace(arrayOctet[i])) { return false; } } return true; }
/** * Tests a given byte array to see if it contains only valid characters within the Base64 alphabet. Currently the * method treats whitespace as valid. * * @param arrayOctet byte array to test * @return {@code true} if all bytes are valid characters in the Base64 alphabet or if the byte array is empty; * {@code false}, otherwise * @since 1.5 */ public static boolean isBase64(final byte[] arrayOctet) { for (int i = 0; i < arrayOctet.length; i++) { if (!isBase64(arrayOctet[i]) && !isWhiteSpace(arrayOctet[i])) { return false; } } return true; }