/** * Tests a given String to see if it contains only valid characters within the alphabet. The * method treats whitespace and PAD as valid. * * @param basen String to test * @return <code>true</code> if all characters in the String are valid characters in the alphabet * or if the String is empty; <code>false</code>, otherwise * @see #isInAlphabet(byte[], boolean) */ public boolean isInAlphabet(final String basen) { return isInAlphabet(StringUtil.getBytesUtf8(basen), true); }
/** * 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</code> if all characters in the String are valid characters in the Base64 * alphabet or if the String is empty; <code>false</code>, otherwise * @since 1.5 */ public static boolean isBase64(final String base64) { return isBase64(StringUtil.getBytesUtf8(base64)); }
/** * Decodes a String containing characters in the Base-N alphabet. * * @param pArray A String containing Base-N character data * @return a byte array containing binary data */ public byte[] decode(final String pArray) { return decode(StringUtil.getBytesUtf8(pArray)); }