@@ -261,6 +261,7 @@ public Base64(int lineLength, byte[] lineSeparator) {
261261 * @param urlSafe
262262 * Instead of emitting '+' and '/' we emit '-' and '_' respectively. urlSafe is only applied to encode
263263 * operations. Decoding seamlessly handles both modes.
264+ * <b>Note: no padding is added when using the URL-safe alphabet.</b>
264265 * @throws IllegalArgumentException
265266 * The provided lineSeparator included some base64 characters. That's not going to work!
266267 * @since 1.4
@@ -305,9 +306,10 @@ public boolean isUrlSafe() {
305306 /**
306307 * <p>
307308 * Encodes all of the provided data, starting at inPos, for inAvail bytes. Must be called at least twice: once with
308- * the data to encode, and once with inAvail set to "-1" to alert encoder that EOF has been reached, so flush last
309+ * the data to encode, and once with inAvail set to "-1" to alert encoder that EOF has been reached, to flush last
309310 * remaining bytes (if not multiple of 3).
310311 * </p>
312+ * <p><b>Note: no padding is added when encoding using the URL-safe alphabet.</b></p>
311313 * <p>
312314 * Thanks to "commons" project in ws.apache.org for the bitwise operations, and general approach.
313315 * http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/
@@ -567,7 +569,7 @@ public static String encodeBase64String(byte[] binaryData) {
567569 /**
568570 * Encodes binary data using a URL-safe variation of the base64 algorithm but does not chunk the output. The
569571 * url-safe variation emits - and _ instead of + and / characters.
570- *
572+ * <b>Note: no padding is added.</b>
571573 * @param binaryData
572574 * binary data to encode
573575 * @return byte[] containing Base64 characters in their UTF-8 representation.
@@ -580,7 +582,7 @@ public static byte[] encodeBase64URLSafe(byte[] binaryData) {
580582 /**
581583 * Encodes binary data using a URL-safe variation of the base64 algorithm but does not chunk the output. The
582584 * url-safe variation emits - and _ instead of + and / characters.
583- *
585+ * <b>Note: no padding is added.</b>
584586 * @param binaryData
585587 * binary data to encode
586588 * @return String containing Base64 characters
@@ -625,6 +627,7 @@ public static byte[] encodeBase64(byte[] binaryData, boolean isChunked) {
625627 * if {@code true} this encoder will chunk the base64 output into 76 character blocks
626628 * @param urlSafe
627629 * if {@code true} this encoder will emit - and _ instead of the usual + and / characters.
630+ * <b>Note: no padding is added when encoding using the URL-safe alphabet.</b>
628631 * @return Base64-encoded data.
629632 * @throws IllegalArgumentException
630633 * Thrown when the input array needs an output array bigger than {@link Integer#MAX_VALUE}
@@ -643,6 +646,7 @@ public static byte[] encodeBase64(byte[] binaryData, boolean isChunked, boolean
643646 * if {@code true} this encoder will chunk the base64 output into 76 character blocks
644647 * @param urlSafe
645648 * if {@code true} this encoder will emit - and _ instead of the usual + and / characters.
649+ * <b>Note: no padding is added when encoding using the URL-safe alphabet.</b>
646650 * @param maxResultSize
647651 * The maximum result size to accept.
648652 * @return Base64-encoded data.
0 commit comments