Skip to content

Commit 3040f29

Browse files
committed
Deprecate isArrayByteBase64 in favor of isBase64 to match other method names.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1063336 13f79535-47bb-0310-9956-ffa450edef68
1 parent 9250cf3 commit 3040f29

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

src/java/org/apache/commons/codec/binary/Base64.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff 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++) {

0 commit comments

Comments
 (0)