File tree Expand file tree Collapse file tree
src/java/org/apache/commons/codec/binary Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -610,9 +610,24 @@ public static boolean isBase64(String base64) {
610610 * @param arrayOctet
611611 * byte array to test
612612 * @return <code>true</code> if all bytes are valid characters in the Base64 alphabet or if the byte array is empty;
613- * false, otherwise
613+ * <code>false</code>, otherwise
614+ * @deprecated Use {@link #isBase64(byte[])}
614615 */
615616 public static boolean isArrayByteBase64 (byte [] arrayOctet ) {
617+ return isBase64 (arrayOctet );
618+ }
619+
620+ /**
621+ * Tests a given byte array to see if it contains only valid characters within the Base64 alphabet. Currently the
622+ * method treats whitespace as valid.
623+ *
624+ * @param arrayOctet
625+ * byte array to test
626+ * @return <code>true</code> if all bytes are valid characters in the Base64 alphabet or if the byte array is empty;
627+ * <code>false</code>, otherwise
628+ * @since 1.5
629+ */
630+ public static boolean isBase64 (byte [] arrayOctet ) {
616631 for (int i = 0 ; i < arrayOctet .length ; i ++) {
617632 if (!isBase64 (arrayOctet [i ]) && !isWhiteSpace (arrayOctet [i ])) {
618633 return false ;
@@ -626,7 +641,7 @@ public static boolean isArrayByteBase64(byte[] arrayOctet) {
626641 *
627642 * @param arrayOctet
628643 * byte array to test
629- * @return <code>true</code> if any byte is a valid character in the Base64 alphabet; false herwise
644+ * @return <code>true</code> if any byte is a valid character in the Base64 alphabet; <code> false</code> otherwise
630645 */
631646 private static boolean containsBase64Byte (byte [] arrayOctet ) {
632647 for (int i = 0 ; i < arrayOctet .length ; i ++) {
You can’t perform that action at this time.
0 commit comments