Package org.epics.pvaccess.util
Class HexDump
- java.lang.Object
-
- org.epics.pvaccess.util.HexDump
-
public class HexDump extends Object
Utility for dumping binary data.- Version:
- $Id$
- Author:
- Matej Sekoranja
-
-
Constructor Summary
Constructors Constructor Description HexDump()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
hexDump(String name, byte[] bs)
Output a buffer in hex format.static void
hexDump(String name, byte[] bs, int len)
Output a buffer in hex format.static void
hexDump(String name, byte[] bs, int start, int len)
Output a buffer in hex format.static void
hexDump(String prologue, String name, byte[] bs, int start, int len)
Output a buffer in hex format.static char
toAscii(byte b)
Get ASCII representation of byte, dot if non-readable.static String
toHex(byte b)
Get hex representation of byte.
-
-
-
Method Detail
-
hexDump
public static void hexDump(String name, byte[] bs)
Output a buffer in hex format.- Parameters:
name
- name (desctription) of the message.bs
- buffer to dump
-
hexDump
public static void hexDump(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(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(String prologue, String name, byte[] bs, int start, int len)
Output a buffer in hex format.- Parameters:
prologue
- string to prefixed to debug output, can benull
name
- name (description) of the message.bs
- buffer to dumpstart
- dump message using given offset.len
- first bytes (length) to dump.
-
toHex
public static final String toHex(byte b)
Get hex representation of byte.- Parameters:
b
- byte to hex.- 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
- byte to ASCII.- Returns:
- ASCII representation of byte, dot if non-readable.
-
-