title: Input byte array has incorrect ending byte at 40
body: <p>I have a string that is base64 encoded. It looks like this:</p>
  
  <pre><code>eyJibGExIjoiYmxhMSIsImJsYTIiOiJibGEyIn0=
  </code></pre>
  
  <p>Any online tool can decode this to the proper string which is <code>{"bla1":"bla1","bla2":"bla2"}</code>. However, my Java implementation fails:</p>
  
  <pre><code>import java.util.Base64;
  System.out.println("payload = " + payload);
  String json = new String(Base64.getDecoder().decode(payload));
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <pre><code>payload = eyJibGExIjoiYmxhMSIsImJsYTIiOiJibGEyIn0=
  java.lang.IllegalArgumentException: Input byte array has incorrect ending byte at 40
  </code></pre>
  
  <p>What is wrong with my code?</p>