code: @SuppressWarnings("StatementWithEmptyBody")
      public static String encode(final byte[] input) {
          ByteArrayInputStream in = new ByteArrayInputStream(input);
          StringBuilder sb = new StringBuilder();
          try {
              while (encodeChunk(sb, in)) {
                  // do nothing
              }
          } catch (IOException ex) {
              throw new RuntimeException(ex);
          }
  
          return sb.toString();
      }
docs: Base64 encode a textual string according to RFC 3548
  
  @param input The string to encode
  @return The encoded string