Package org.agrona
Class PrintBufferUtil.HexUtil
java.lang.Object
org.agrona.PrintBufferUtil.HexUtil
- Enclosing class:
PrintBufferUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void
appendHexDumpRowPrefix
(StringBuilder dump, int row, int rowStartIndex) (package private) static void
appendPrettyHexDump
(StringBuilder dump, DirectBuffer buffer, int offset, int length) (package private) static short
getUnsignedByte
(DirectBuffer buffer, int index) Gets an unsigned byte at the specified absoluteindex
in a buffer.(package private) static String
hexDump
(byte[] array, int fromIndex, int length) (package private) static String
hexDump
(DirectBuffer buffer, int fromIndex, int length) (package private) static boolean
isOutOfBounds
(int index, int length, int capacity) Determine if the requestedindex
andlength
will fit withincapacity
.(package private) static String
prettyHexDump
(DirectBuffer buffer, int offset, int length)
-
Field Details
-
BYTE2CHAR
private static final char[] BYTE2CHAR -
HEXDUMP_TABLE
private static final char[] HEXDUMP_TABLE -
HEX_PADDING
-
HEXDUMP_ROW_PREFIXES
-
BYTE2HEX
-
BYTE_PADDING
-
-
Constructor Details
-
HexUtil
HexUtil()
-
-
Method Details
-
getUnsignedByte
Gets an unsigned byte at the specified absoluteindex
in a buffer.- Parameters:
buffer
- the source of value.index
- the absoluteindex
in the buffer.- Returns:
- unsigned byte value.
-
hexDump
-
hexDump
-
prettyHexDump
-
isOutOfBounds
static boolean isOutOfBounds(int index, int length, int capacity) Determine if the requestedindex
andlength
will fit withincapacity
.- Parameters:
index
- The starting index.length
- The length which will be utilized (starting fromindex
).capacity
- The capacity thatindex + length
is allowed to be within.- Returns:
true
if the requestedindex
andlength
will fit withincapacity
.false
if this would result in an index out of bounds exception.
-
appendPrettyHexDump
-
appendHexDumpRowPrefix
-