Class Hexs

java.lang.Object
pcap.common.util.Hexs

@Inclubating
public final class Hexs
extends Object
Author:
Ardika Rommy Sanjaya
  • Constructor Details

    • Hexs

      public Hexs()
  • Method Details

    • toHexString

      public static String toHexString​(ByteBuffer buffer)
      ByteBuffer to hex string.
      Parameters:
      buffer - buffer.
      Returns:
      returns hex string.
    • toHexString

      public static String toHexString​(ByteBuffer buffer, int offset, int length)
      ByteBuffer to hex string.
      Parameters:
      buffer - buffer.
      offset - offset.
      length - length.
      Returns:
      returns hex string.
    • toHexString

      public static String toHexString​(byte[] buffer)
      ByteBuffer to hex string.
      Parameters:
      buffer - buffer.
      Returns:
      returns hex string.
    • toHexString

      public static String toHexString​(byte[] buffer, int offset, int length)
      ByteBuffer to hex string.
      Parameters:
      buffer - buffer.
      offset - offset.
      length - length.
      Returns:
      returns hex string.
    • toPrettyHexDump

      public static String toPrettyHexDump​(byte[] data)
      Byte array to hex dump format.
      Parameters:
      data - byte array.
      Returns:
      hex dump format.
      Since:
      1.0.0
    • toPrettyHexDump

      public static String toPrettyHexDump​(byte[] data, int offset, int length)
      Byte array to hex dump format.
      Parameters:
      data - byte array.
      offset - offset.
      length - length.
      Returns:
      hex dump format.
      Since:
      1.0.0
    • toPrettyHexDump

      public static String toPrettyHexDump​(ByteBuffer buffer, int offset, int length)
      Byte buffer to hex dump format.
      Parameters:
      buffer - byte buffer.
      offset - offset.
      length - length.
      Returns:
      hex dump format.
      Since:
      1.1.0
    • parseHex

      public static byte[] parseHex​(String hexStream)
      Hex stream to byte array.
      Parameters:
      hexStream - hex stream.
      Returns:
      byte array.
      Since:
      1.0.0