title: Java: Universal BaseN encoder/decoder working with large data sizes
body: <p>I'm looking for a decent BaseN encoder (with custom charset) in Java, that is not limited by input data size (array of bytes).</p>
  
  <p><strong>Something like this:</strong></p>
  
  <blockquote>
    <p><a href="https://github.com/mklemm/base-n-codec-java" rel="nofollow noreferrer">https://github.com/mklemm/base-n-codec-java</a></p>
  </blockquote>
  
  <p>But for "unlimited" data length without any unnecessary memory/performance penalty and "BigInteger abuse magic". Simply something that works as standard BASE64 encoders, but universally for any base/charset. Any solution, or idea how to achieve that is welcomed.</p>
  
  <p><strong>Maybe, if someone has experiences with apache BaseNCodec:</strong></p>
  
  <blockquote>
    <p><a href="https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/BaseNCodec.html" rel="nofollow noreferrer">https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/BaseNCodec.html</a></p>
  </blockquote>
  
  <p>It looked promising, however it's an Abstract class, and available implemetations look harder to make, than start from scratch.
  <hr/>
   I need it for a binary data to custom character set encoder (where the number of characters in the set is mutable, <code>"ABCDE" = Base5</code>, <code>"ABCDE-+*/." = Base10</code>, ...).
  <hr/>
  <strong>Update:</strong>
  The "Base N Codec" from GitHub (above) seems to be buggy, so I used the following code at the end:</p>
  
  <blockquote>
    <p><a href="https://dzone.com/articles/base-x-encoding" rel="nofollow noreferrer">https://dzone.com/articles/base-x-encoding</a></p>
  </blockquote>