title: How to convert sun.misc.BASE64Encoder to org.apache.commons.codec.binary.Base64
body: <p>I have the following code for <code>sun.misc.BASE64Encoder</code>:</p>
  
  <pre><code>BASE64Decoder decoder = new BASE64Decoder();
  byte[] saltArray = decoder.decodeBuffer(saltD);
  byte[] ciphertextArray = decoder.decodeBuffer(ciphertext);
  </code></pre>
  
  <p>and would like to convert it to <code>org.apache.commons.codec.binary.Base64</code>. I've gone through the APIs, the docs, etc., but I can't find something that seems to match and give the same resulting values.</p>