title: Java - decode base64 - Illegal base64 character 1
body: <p>I have following data in a file:
  <a href="https://i.stack.imgur.com/1Ubcy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1Ubcy.png" alt="enter image description here"></a></p>
  
  <p>I want to decode the UserData. On reading it as string <code>comment</code>, I'm doing following:</p>
  
  <pre><code>String[] split = comment.split("=");
  if(split[0].equals("UserData")) {
      System.out.println(split[1]);
      byte[] callidArray = Arrays.copyOf(java.util.Base64.getDecoder().decode(split[1]), 9);
      System.out.println("UserData:" + Hex.encodeHexString(callidArray).toString());
  }
  </code></pre>
  
  <p>But I'm getting the following exception:</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: Illegal base64 character 1</p>
  </blockquote>
  
  <p>What could be the reason?</p>