Package org.apache.mina.core.buffer
Class IoBufferHexDumper
- java.lang.Object
-
- org.apache.mina.core.buffer.IoBufferHexDumper
-
class IoBufferHexDumper extends Object
Provides utility methods to dump anIoBufferinto a hex formatted string.- Author:
- Apache MINA Project
-
-
Constructor Summary
Constructors Constructor Description IoBufferHexDumper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetHexDumpSlice(IoBuffer buf, int offset, int length)Dumps anIoBufferto a hex formatted string.static StringgetPrettyHexDumpSlice(IoBuffer buf, int offset, int length)Produces a verbose hex dumpstatic StringtoHex(byte b)static StringtoPrettyHexDump(byte[] data, int pos, int len)Generates a hex dump with line numbers, hex, volumes, and ascii representation
-
-
-
Method Detail
-
getHexDumpSlice
public static 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 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 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
-
toHex
public static final String toHex(byte b)
-
-