docs: public static String base64encode( byte[] code ) {
          if ( null == code )
              return null;
          if ( 0 == code.length )
              return new String();
          int len = code.length;
          // remainder of the encoding process
          int rem = len % 3;
          // size of the destination byte array
          byte[] dst = new byte[4 + (((len - 1) / 3) << 2) + (len / 57)];
          // actual column of the destination string;
          // RFC 1341 requires a linefeed every 58 data bytes
          int column = 0;
          // position within source
          int spos = 0;
          // position within destination
          int dpos = 0;
          // adjust length for loop (remainder is treated separately)
          len -= 2;
          // using a while loop here since spos may be needed for the remainder
          while ( spos < len ) {
              byte b0 = code[ spos ];
              byte b1 = code[ spos + 1 ];
              byte b2 = code[ spos + 2 ];
              dst[ dpos++ ] = _base64en[ 0x3f & (b0 >>> 2) ];
              dst[ dpos++ ] = _base64en[ (0x30 & (b0 << 4)) + (0x0f & (b1 >>> 4)) ];
              dst[ dpos++ ] = _base64en[ (0x3c & (b1 << 2)) + (0x03 & (b2 >>> 6)) ];
              dst[ dpos++ ] = _base64en[ 0x3f & b2 ];
              spos += 3;
              column += 3;
              if ( 57 == column ) {
                  dst[ dpos++ ] = 10;
                  column = 0;
              }
          }
          // there may be a remainder to be processed
          if ( 0 != rem ) {
              byte b0 = code[ spos ];
              dst[ dpos++ ] = _base64en[ 0x3f & (b0 >>> 2) ];
              if ( 1 == rem ) {
                  // one-byte remainder
                  dst[ dpos++ ] = _base64en[ 0x30 & (b0 << 4) ];
                  dst[ dpos++ ] = 61;
              } else {
                  // two-byte remainder
                  byte b1 = code[ spos + 1 ];
                  dst[ dpos++ ] = _base64en[ (0x30 & (b0 << 4)) + (0x0f & (b1 >>> 4)) ];
                  dst[ dpos++ ] = _base64en[ 0x3c & (b1 << 2) ];
              }
              dst[ dpos++ ] = 61;
          }
          // using any default encoding is possible, since the base64 char subset is
          // identically represented in all ISO encodings, including US-ASCII
          return new String( dst );
      }