Class HexCodec


  • public class HexCodec
    extends java.lang.Object
    Utility class for en-/decoding hexadecimal strings.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String hexDump​(byte @NotNull [] data, int start, int end)
      Returns a hex dump of a part of a byte array.
      static void hexEncode2​(@NotNull java.lang.StringBuilder sb, int value)
      Append a given value as a two digits hexadecimal number.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • hexEncode2

        public static void hexEncode2​(@NotNull
                                      @NotNull java.lang.StringBuilder sb,
                                      int value)
        Append a given value as a two digits hexadecimal number.
        Parameters:
        sb - the StringBuilder to append to
        value - the value to append
      • hexDump

        public static java.lang.String hexDump​(byte @NotNull [] data,
                                               int start,
                                               int end)
        Returns a hex dump of a part of a byte array.
        Parameters:
        data - the byte array to dump
        start - the starting index
        end - the end index
        Returns:
        the hex dump