Java XML Base64 Encode Decode decode(String base64)

Here you can find the source of decode(String base64)

Description

Decode the given Base64 String to a byte array

License

Apache License

Parameter

Parameter Description
hex a parameter

Declaration

public static byte[] decode(String base64) 

Method Source Code


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

import javax.xml.bind.DatatypeConverter;

public class Main {
    /**//  w w  w  .  j  a va  2s  .  c  om
     * Decode the given Base64 String to a byte array
     * @param hex
     * @return
     */
    public static byte[] decode(String base64) {
        return DatatypeConverter.parseBase64Binary(base64);

    }
}

Related

  1. byteArrayToBase64String(byte[] data)
  2. BytesToBase64String(final byte[] value)
  3. byteToBase64(byte[] data)
  4. compressToBase64(byte[] message)
  5. createBase64EncodedStringFromURL(URL url)
  6. decodeBase64(File file)
  7. decodeBase64(String b64data)
  8. decodeBase64(String base64)
  9. decodeBase64(String s)