Package org.agrona

Class PrintBufferUtil.HexUtil

java.lang.Object
org.agrona.PrintBufferUtil.HexUtil
Enclosing class:
PrintBufferUtil

static final class PrintBufferUtil.HexUtil extends Object
  • Field Details

    • BYTE2CHAR

      private static final char[] BYTE2CHAR
    • HEXDUMP_TABLE

      private static final char[] HEXDUMP_TABLE
    • HEX_PADDING

      private static final String[] HEX_PADDING
    • HEXDUMP_ROW_PREFIXES

      private static final String[] HEXDUMP_ROW_PREFIXES
    • BYTE2HEX

      private static final String[] BYTE2HEX
    • BYTE_PADDING

      private static final String[] BYTE_PADDING
  • Constructor Details

    • HexUtil

      HexUtil()
  • Method Details

    • getUnsignedByte

      static short getUnsignedByte(DirectBuffer buffer, int index)
      Gets an unsigned byte at the specified absolute index in a buffer.
      Parameters:
      buffer - the source of value.
      index - the absolute index in the buffer.
      Returns:
      unsigned byte value.
    • hexDump

      static String hexDump(DirectBuffer buffer, int fromIndex, int length)
    • hexDump

      static String hexDump(byte[] array, int fromIndex, int length)
    • prettyHexDump

      static String prettyHexDump(DirectBuffer buffer, int offset, int length)
    • isOutOfBounds

      static boolean isOutOfBounds(int index, int length, int capacity)
      Determine if the requested index and length will fit within capacity.
      Parameters:
      index - The starting index.
      length - The length which will be utilized (starting from index).
      capacity - The capacity that index + length is allowed to be within.
      Returns:
      true if the requested index and length will fit within capacity. false if this would result in an index out of bounds exception.
    • appendPrettyHexDump

      static void appendPrettyHexDump(StringBuilder dump, DirectBuffer buffer, int offset, int length)
    • appendHexDumpRowPrefix

      static void appendHexDumpRowPrefix(StringBuilder dump, int row, int rowStartIndex)