title: Base 64 encode and decode example code
body: <p>Does anyone know how to decode and encode a string in Base64 using the Base64. I am using the following code, but it's not working.</p>
  
  <pre><code>String source = "password"; 
  byte[] byteArray = source.getBytes("UTF-16"); 
  Base64 bs = new Base64(); 
  //bs.encodeBytes(byteArray); 
  System.out.println( bs.encodeBytes(byteArray)); 
  //bs.decode(bs.encodeBytes(byteArray));
  System.out.println(bs.decode(bs.encodeBytes(byteArray)));
  </code></pre>