title: Similar Java function like atob in javascript
body: <p>I have Query parameter that was encoded by <code>btoa</code> javascript function. when url clicked, request function called inside java controller where i wanted to decode Query parameter (which is encoded from javascript btoa). i have tried <code>BASE64Decoder</code> and <code>Base64.getDecoder()</code> but not able to get proper value. is there any other way to do so?</p>
  
  <p><strong>Java Controller</strong></p>
  
  <pre><code>@RequestMapping(value = "decode/{email}", method = RequestMethod.GET)
      public String decodeEmail(Model model, @PathVariable String email){
          Decode decode = new Decode();
          decode.setEmail(email);
          decodeService.save(decode);
          return "decode/List";
      }
  </code></pre>
  
  <p><strong>JavaScript</strong></p>
  
  <pre><code>var email = document.getElementById("email").value;
  var encodedEmail = btoa(email);
  </code></pre>
  
  <p><strong>Example</strong></p>
  
  <p>String to encode : demo@demo.com</p>
  
  <p>Encoded String : ZGVtb0BkZW1vLmNvbQ==</p>