Java XML Base64 Encode Decode fromBase64(String hex)

Here you can find the source of fromBase64(String hex)

Description

Converts a string of hexadecimal characters into a byte array.

License

Open Source License

Parameter

Parameter Description
hex the hex string

Return

the hex string decoded into a byte array

Declaration

private static byte[] fromBase64(String hex) 

Method Source Code

//package com.java2s;

import javax.xml.bind.DatatypeConverter;

public class Main {
    /**//w w w  .  ja va  2 s .c  om
     * Converts a string of hexadecimal characters into a byte array.
     *
     * @param   hex         the hex string
     * @return              the hex string decoded into a byte array
     */
    private static byte[] fromBase64(String hex) {
        return DatatypeConverter.parseBase64Binary(hex);
    }
}

Related

  1. encodeBASE64(byte[] data)
  2. encodeBase64(String input)
  3. encodeBase64(String stringValue)
  4. encodeBase64Binary(byte[] data)
  5. fromBase64(String base64)
  6. getBase64(byte[] bytes)
  7. getHashBase64(String origStr, String digestAlgorithm)
  8. readBase64Bytes(String str)
  9. readFileToBase64(String filePath)