title: Encode/decode Base64 fails
body: <p>in my application client-server, on client side I send the file content in following format:</p>
  
  <pre><code>public static String getImageFromURI (Context contesto, Uri uri) {
      InputStream is;
      ByteArrayOutputStream bos;
      try {
          is = contesto.getContentResolver().openInputStream(uri);
          bos = new ByteArrayOutputStream();
  
          byte[] buf = new byte[1024];
          try {
              for (int readNum; (readNum = is.read(buf)) != -1;) {
                  bos.write(buf, 0, readNum); //no doubt here is 0
              }
          } catch (IOException ex) {
              Log.d("TAG_F2S", "Sono nel catch IOExcetion con emssage = " + ex.getMessage());
              ex.printStackTrace();
              return null;
          }
  
          return new String (Base64.encode(bos.toByteArray(), Base64.DEFAULT), "UTF-8");
      } catch (FileNotFoundException fnfe) {
          Log.d("TAG_F2S", "Sono nel catch FileNotFoundExcetion con emssage = " + fnfe.getMessage());
          fnfe.printStackTrace();
  
          return null;
      } catch (UnsupportedEncodingException uee) {
          Log.d("TAG_F2S", "Sono nel catch UnsupportedEncodingExcetion con emssage = " + uee.getMessage());
          uee.printStackTrace();
  
          return null;
      }
  }
  </code></pre>
  
  <p>and on server side I try to create the file as follow:</p>
  
  <pre><code>byte [] byteFile = java.util.Base64.getDecoder ().decode(contenuto.getBytes("UTF-8"));
  
  Files.write(Paths.get(myPath), byteFile);
  </code></pre>
  
  <p>But I can't obtain the result cause the exception like this:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Illegal base64 character a
  at java.util.Base64$Decoder.decode0(Unknown Source)
  at java.util.Base64$Decoder.decode(Unknown Source)
  ....
  </code></pre>
  
  <p>What's my error? I don't understand..
  Thanks for your help.</p>
  
  <hr>
  
  <p>EDIT:
  The String that i send to the server is the following:
  <a href="https://codeshare.io/GqQWNA" rel="nofollow noreferrer">https://codeshare.io/GqQWNA</a></p>