commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1063336 - /commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java
Date Tue, 25 Jan 2011 16:18:42 GMT
Author: ggregory
Date: Tue Jan 25 16:18:42 2011
New Revision: 1063336

URL: http://svn.apache.org/viewvc?rev=1063336&view=rev
Log:
Deprecate isArrayByteBase64 in favor of isBase64 to match other method names.

Modified:
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java

Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java?rev=1063336&r1=1063335&r2=1063336&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java (original)
+++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java Tue Jan
25 16:18:42 2011
@@ -610,9 +610,24 @@ public class Base64 implements BinaryEnc
      * @param arrayOctet
      *            byte array to test
      * @return <code>true</code> if all bytes are valid characters in the Base64
alphabet or if the byte array is empty;
-     *         false, otherwise
+     *         <code>false</code>, otherwise
+     * @deprecated Use {@link #isBase64(byte[])}
      */
     public static boolean isArrayByteBase64(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</code> if all bytes are valid characters in the Base64
alphabet or if the byte array is empty;
+     *         <code>false</code>, otherwise
+     * @since 1.5
+     */    
+    public static boolean isBase64(byte[] arrayOctet) {
         for (int i = 0; i < arrayOctet.length; i++) {
             if (!isBase64(arrayOctet[i]) && !isWhiteSpace(arrayOctet[i])) {
                 return false;
@@ -626,7 +641,7 @@ public class Base64 implements BinaryEnc
      * 
      * @param arrayOctet
      *            byte array to test
-     * @return <code>true</code> if any byte is a valid character in the Base64
alphabet; false herwise
+     * @return <code>true</code> if any byte is a valid character in the Base64
alphabet; <code>false</code> otherwise
      */
     private static boolean containsBase64Byte(byte[] arrayOctet) {
         for (int i = 0; i < arrayOctet.length; i++) {



Mime
View raw message