rceIndex, end, firstPadding,
        paddingCount, length);
  } else {
    &#47;&#47; No padding given, so add some if needed it.
    var endLength = length % 4;
    if (endLength == 1) {
      &#47;&#47; The data must have length 0, 2 or 3 modulo 4.
      throw FormatException(&quot;Invalid base64 encoding length &quot;, source, end);
    }
    if (endLength &gt; 1) {
      &#47;&#47; There is no &quot;insertAt&quot; on String, but this works as well.
      source = source.replaceRange(end, end, (endLength