Java Base64 Convert to fromBase64(final String encoded)

Here you can find the source of fromBase64(final String encoded)

Description

Decode a String from its base64 representation.

License

Apache License

Parameter

Parameter Description
encoded The String to decode.

Return

The decoded .

Declaration

public static String fromBase64(final String encoded) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Base64;

public class Main {
    /**//w w w  .ja v  a 2s  . c o m
     * Decode a {@link String} from its base64 representation.
     *
     * @param encoded
     *            The {@link String} to decode.
     * @return The decoded {@link String}.
     */
    public static String fromBase64(final String encoded) {
        final byte[] bytearray = Base64.getDecoder().decode(encoded);
        return (new String(bytearray));
    }
}

Related

  1. base64StrToStream(String base64Str)
  2. base64ToByte(String data)
  3. base64ToByteArray(String data)
  4. base64ToFile(String base64Code, String targetPath)
  5. fromBase64(byte[] buf, int start, int length)
  6. fromBase64(final String input)
  7. fromBase64(String base64)
  8. fromBase64(String base64Text)
  9. fromBase64(String data)