@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();
    }
@ SuppressWarnings ( "StatementWithEmptyBody" ) public static String encode ( final byte [ ] input ) { ByteArrayInputStream in = new ByteArrayInputStream ( input ) ; StringBuilder sb = new StringBuilder ( ) ; try { while ( encodeChunk ( sb , in ) ) { } } catch ( IOException ex ) { throw new RuntimeException ( ex ) ; } return sb . toString ( ) ; }
Base64 encode a textual string according to RFC 3548

@param input The string to encode
@return The encoded string