HexBin (xmlbeans API)

org.apache.xmlbeans.impl.util

## Class HexBin

- java.lang.Object
- - org.apache.xmlbeans.impl.util.HexBin

-     public final class HexBin
      extends Object

  This class encodes/decodes hexadecimal data.

  This class is for internal use in Apache XMLBeans. If you need to do your own hexadecimal encoding/decoding, please find another library that specialises in this sort of support.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HexBin()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `bytesToString(byte[] binaryData)` Converts bytes to a hex string
    `static byte[]` | `decode(byte[] binaryData)`
    `static String` | `decode(String binaryData)` Decodes Hex data into octects
    `static byte[]` | `encode(byte[] binaryData)` array of byte to encode
    `static String` | `encode(String binaryData)` Encodes octects (using utf-8) into Hex data
    `static byte[]` | `stringToBytes(String hexEncoded)` Converts a hex string to a byte array.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HexBin

          public HexBin()

  - ### Method Detail

    - #### bytesToString

          public static String bytesToString(byte[] binaryData)

      Converts bytes to a hex string

    - #### stringToBytes

          public static byte[] stringToBytes(String hexEncoded)

      Converts a hex string to a byte array.

    - #### encode

          public static byte[] encode(byte[] binaryData)

      array of byte to encode
      Returns:
        return encode binary array

    - #### decode

          public static byte[] decode(byte[] binaryData)

      Parameters:
        `binaryData` - input data
      Returns:
        decoded bytes - can return null if the input is null, empty or includes bytes that are not valid Hex

    - #### decode

          public static String decode(String binaryData)

      Decodes Hex data into octects
      Parameters:
        `binaryData` - String containing Hex data
      Returns:
        string containing decoded data.

    - #### encode

          public static String encode(String binaryData)

      Encodes octects (using utf-8) into Hex data
      Parameters:
        `binaryData` - String containing Hex data
      Returns:
        string containing decoded data.