Java XML Hex hexToString(String str)

Here you can find the source of hexToString(String str)

Description

Converts a hexadecimal String to the equivalent lexical representation.

License

Open Source License

Parameter

Parameter Description
str The String to convert.

Return

A String containing a lexical representation of the given hexadecimal argument.

Declaration

public static String hexToString(String str) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.xml.bind.DatatypeConverter;

public class Main {
    /**/*w w  w  . ja  v a  2 s.  c om*/
     * Converts a hexadecimal {@code String} to the equivalent lexical 
     * representation.
     * 
     * @param str The {@code String} to convert.
     * @return A {@code String} containing a lexical representation of the given
     *         hexadecimal argument.
     */
    public static String hexToString(String str) {
        return new String(DatatypeConverter.parseHexBinary(str));
    }
}

Related

  1. hexOutSpaces(byte[] byteArray)
  2. hexStringToByteArray(String hex)
  3. hexStringToByteArray(String s)
  4. hexStringToBytes(String text)
  5. hexToBytes(final String s)
  6. printHexBinary(byte[] in)
  7. printHexBinary(final byte[] deviceMessage)
  8. readHexString(ByteBuffer buf)
  9. sha1Hex(final String text)