commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r794480 - /commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java
Date Thu, 16 Jul 2009 01:05:43 GMT
Author: ggregory
Date: Thu Jul 16 01:05:42 2009
New Revision: 794480

URL: http://svn.apache.org/viewvc?rev=794480&view=rev
Log:
[#CODEC-75] Make Base64 URL-safe. Remove unused method.

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=794480&r1=794479&r2=794480&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 Thu Jul
16 01:05:42 2009
@@ -792,26 +792,6 @@
         }
     }
 
-    /**
-     * Discards any characters outside of the base64 alphabet, per the requirements on page
25 of RFC 2045 - "Any
-     * characters outside of the base64 alphabet are to be ignored in base64 encoded data."
-     * 
-     * @param data
-     *            The base-64 encoded data to groom
-     * @return The data, less non-base64 characters (see RFC 2045).
-     */
-    static byte[] discardNonBase64(byte[] data) {
-        byte groomedData[] = new byte[data.length];
-        int bytesCopied = 0;
-        for (int i = 0; i < data.length; i++) {
-            if (isBase64(data[i])) {
-                groomedData[bytesCopied++] = data[i];
-            }
-        }
-        byte packedData[] = new byte[bytesCopied];
-        System.arraycopy(groomedData, 0, packedData, 0, bytesCopied);
-        return packedData;
-    }
 
     // Implementation of the Encoder Interface
 



Mime
View raw message