ngth == 1) {
        &#47;&#47; The data must have length 0, 2 or 3 modulo 4.
        throw FormatException(&quot;Invalid base64 encoding length &quot;, source, end);
      }
      while (endLength &lt; 4) {
        buffer.write(&quot;=&quot;);
        endLength++;
      }
    }
    return source.replaceRange(start, end, buffer.toString());
  }
  &#47;&#47; Original was already normalized, only check padding.
  var length = end - start;
  if (firstPadding &gt;= 0) {
    _checkPadding(source, firstPaddingSou