Package org.agrona

Class PrintBufferUtil.HexUtil

  • Enclosing class:
    PrintBufferUtil

    static final class PrintBufferUtil.HexUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      HexUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static void appendHexDumpRowPrefix​(java.lang.StringBuilder dump, int row, int rowStartIndex)  
      (package private) static void appendPrettyHexDump​(java.lang.StringBuilder dump, DirectBuffer buffer, int offset, int length)  
      (package private) static short getUnsignedByte​(DirectBuffer buffer, int index)
      Gets an unsigned byte at the specified absolute index in a buffer.
      (package private) static java.lang.String hexDump​(byte[] array, int fromIndex, int length)  
      (package private) static java.lang.String hexDump​(DirectBuffer buffer, int fromIndex, int length)  
      (package private) static boolean isOutOfBounds​(int index, int length, int capacity)
      Determine if the requested index and length will fit within capacity.
      (package private) static java.lang.String prettyHexDump​(DirectBuffer buffer, int offset, int length)  
      • Methods inherited from class java.lang.Object

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

      • BYTE2CHAR

        private static final char[] BYTE2CHAR
      • HEXDUMP_TABLE

        private static final char[] HEXDUMP_TABLE
      • HEX_PADDING

        private static final java.lang.String[] HEX_PADDING
      • HEXDUMP_ROW_PREFIXES

        private static final java.lang.String[] HEXDUMP_ROW_PREFIXES
      • BYTE2HEX

        private static final java.lang.String[] BYTE2HEX
      • BYTE_PADDING

        private static final java.lang.String[] BYTE_PADDING
    • Constructor Detail

      • HexUtil

        HexUtil()
    • Method Detail

      • 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 java.lang.String hexDump​(DirectBuffer buffer,
                                        int fromIndex,
                                        int length)
      • hexDump

        static java.lang.String hexDump​(byte[] array,
                                        int fromIndex,
                                        int length)
      • prettyHexDump

        static java.lang.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​(java.lang.StringBuilder dump,
                                        DirectBuffer buffer,
                                        int offset,
                                        int length)
      • appendHexDumpRowPrefix

        static void appendHexDumpRowPrefix​(java.lang.StringBuilder dump,
                                           int row,
                                           int rowStartIndex)