Package org.apache.mina.core.buffer
Class IoBufferHexDumper
- java.lang.Object
-
- org.apache.mina.core.buffer.IoBufferHexDumper
-
class IoBufferHexDumper extends java.lang.ObjectProvides utility methods to dump anIoBufferinto a hex formatted string.
-
-
Field Summary
Fields Modifier and Type Field Description private static char[]hexDigit
-
Constructor Summary
Constructors Constructor Description IoBufferHexDumper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetHexDumpSlice(IoBuffer buf, int offset, int length)Dumps anIoBufferto a hex formatted string.static java.lang.StringgetPrettyHexDumpSlice(IoBuffer buf, int offset, int length)Produces a verbose hex dumpstatic java.lang.StringtoHex(byte b)static java.lang.StringtoPrettyHexDump(byte[] data, int pos, int len)Generates a hex dump with line numbers, hex, volumes, and ascii representationprivate static java.lang.StringtoPrettyHexDumpLine(byte[] data, int pos, int len, int col, int line)Generates the hex dump line with hex values, columns, and ascii representation
-
-
-
Method Detail
-
getHexDumpSlice
public static java.lang.String getHexDumpSlice(IoBuffer buf, int offset, int length)
Dumps anIoBufferto a hex formatted string.- Parameters:
buf- the buffer to dumpoffset- the starting position to begin reading the hex dumplength- the number of bytes to dump- Returns:
- a hex formatted string representation of the in
IoBuffer.
-
getPrettyHexDumpSlice
public static final java.lang.String getPrettyHexDumpSlice(IoBuffer buf, int offset, int length)
Produces a verbose hex dump- Parameters:
offset- initial position which to read byteslength- number of bytes to display- Returns:
- The formatted String representing the content between (offset) and (offset+count)
-
toPrettyHexDump
public static final java.lang.String toPrettyHexDump(byte[] data, int pos, int len)Generates a hex dump with line numbers, hex, volumes, and ascii representation- Parameters:
data- source data to read for the hex dumppos- index position to begin readinglen- number of bytes to read- Returns:
- string hex dump
-
toPrettyHexDumpLine
private static final java.lang.String toPrettyHexDumpLine(byte[] data, int pos, int len, int col, int line)Generates the hex dump line with hex values, columns, and ascii representation- Parameters:
data- source data to read for the hex dumppos- index position to begin readinglen- number of bytes to read; this can be less than thelinewidthcol- number of bytes in a columnline- line width in bytes which pads the output iflenis less thanline- Returns:
- string hex dump
-
toHex
public static final java.lang.String toHex(byte b)
-
-