Package org.epics.ca.util
Class HexDump
- java.lang.Object
-
- org.epics.ca.util.HexDump
-
public class HexDump extends java.lang.ObjectUtility for dumping binary data.
-
-
Constructor Summary
Constructors Constructor Description HexDump()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidhexDump(java.lang.String name, byte[] bs)Output a buffer in hex format.static voidhexDump(java.lang.String name, byte[] bs, int len)Output a buffer in hex format.static voidhexDump(java.lang.String name, byte[] bs, int start, int len)Output a buffer in hex format.static voidhexDump(java.lang.String prologue, java.lang.String name, byte[] bs, int start, int len)Output a buffer in hex format.static chartoAscii(byte b)Get ASCII representation of byte, dot if non-readable.static java.lang.StringtoHex(byte b)Get hex representation of byte.
-
-
-
Method Detail
-
hexDump
public static void hexDump(java.lang.String name, byte[] bs)Output a buffer in hex format.- Parameters:
name- name (description) of the message.bs- buffer to dump
-
hexDump
public static void hexDump(java.lang.String name, byte[] bs, int len)Output a buffer in hex format.- Parameters:
name- name (description) of the message.bs- buffer to dumplen- first bytes (length) to dump.
-
hexDump
public static void hexDump(java.lang.String name, byte[] bs, int start, int len)Output a buffer in hex format.- Parameters:
name- name (description) of the message.bs- buffer to dumpstart- dump message using given offset.len- first bytes (length) to dump.
-
hexDump
public static void hexDump(java.lang.String prologue, java.lang.String name, byte[] bs, int start, int len)Output a buffer in hex format.- Parameters:
prologue- string to prefixed to debug output, can benullname- name (description) of the message.bs- buffer to dumpstart- dump message using given offset.len- first bytes (length) to dump.
-
toHex
public static final java.lang.String toHex(byte b)
Get hex representation of byte.- Parameters:
b- the byte to convert.- Returns:
- string hex representation of byte.
-
toAscii
public static final char toAscii(byte b)
Get ASCII representation of byte, dot if non-readable.- Parameters:
b- the byte to convert.- Returns:
- ASCII representation of byte, dot if non-readable.
-
-