Uploaded image for project: 'Commons Codec'
  1. Commons Codec
  2. CODEC-224

Add convenience API org.apache.commons.codec.binary.Hex.encodeHexString(byte[]|ByteBuffer, boolean)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.11
    • None

    Description

      Add convenience APIs:

      org.apache.commons.codec.binary.Hex.encodeHexString(byte[], boolean):

          /**
           * Converts an array of bytes into a String representing the hexadecimal values of each byte in order. The returned
           * String will be double the length of the passed array, as it takes two characters to represent any given byte.
           *
           * @param data
           *            a byte[] to convert to Hex characters
           * @param toLowerCase
           *            <code>true</code> converts to lowercase, <code>false</code> to uppercase
           * @return A String containing lower-case hexadecimal characters
           * @since 1.11
           */
          public static String encodeHexString(final byte[] data, boolean toLowerCase)
      

      org.apache.commons.codec.binary.Hex.encodeHexString(ByteBuffer, boolean):

          /**
           * Converts a byte buffer into a String representing the hexadecimal values of each byte in order. The returned
           * String will be double the length of the passed array, as it takes two characters to represent any given byte.
           *
           * @param data
           *            a byte buffer to convert to Hex characters
           * @param toLowerCase
           *            <code>true</code> converts to lowercase, <code>false</code> to uppercase
           * @return A String containing lower-case hexadecimal characters
           * @since 1.11
           */
          public static String encodeHexString(final ByteBuffer data, boolean toLowerCase)
      

      Attachments

        Issue Links

          Activity

            People

              ggregory Gary D. Gregory
              ggregory Gary D. Gregory
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: