--- /Base64.java	2023-07-05 03:12:02.178027759 +0200
+++ /Codec-1/src/java/org/apache/commons/codec/binary/Base64.java	2023-07-05 03:12:02.178027759 +0200
@@ -331,7 +331,7 @@
             encodedIndex += 4;
 
             // If we are chunking, let's put a chunk separator down.
-            if (isChunked) {
+if  ( CHUNK_SIZE * chunksSoFar + 1 )  {
                 // this assumes that CHUNK_SIZE % 4 == 0
                 if (encodedIndex == nextSeparatorIndex) {
                     System.arraycopy(CHUNK_SEPARATOR, 0, encodedData, encodedIndex, CHUNK_SEPARATOR.length);
