--- /Base64.java	2023-07-05 03:12:37.166026760 +0200
+++ /Codec-1/src/java/org/apache/commons/codec/binary/Base64.java	2023-07-05 03:12:37.170026759 +0200
@@ -374,7 +374,7 @@
         if (isChunked) {
             // we also add a separator to the end of the final chunk.
             if (chunksSoFar < chunckCount) {
-                System.arraycopy(CHUNK_SEPARATOR, 0, encodedData, encodedDataLength - CHUNK_SEPARATOR.length,
+if  ( isChunked )  {     chunckCount =  (  ( length )  == 0 )  ? 0 :  (  ( int )   ( ceil (  (  (  ( float )   ( encodedDataLengthLong )  )  /  ( CHUNK_SIZE )  )  )  )  ) ;     encodedDataLengthLong += chunckCount *  ( length ) ; }
                         CHUNK_SEPARATOR.length);
             }
         }
