Package cx.ath.matthew.utils
Class Hexdump
java.lang.Object
cx.ath.matthew.utils.Hexdump
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
format
(byte[] buf) static String
format
(byte[] buf, int width) static void
print
(byte[] buf) static void
print
(byte[] buf, int width) static void
print
(byte[] buf, int width, PrintStream out) static void
print
(byte[] buf, PrintStream out) static String
toAscii
(byte[] buf) static String
toAscii
(byte[] buf, int ofs, int len) static String
toByteArray
(byte[] buf) Returns a string which can be written to a Java source file as part of a static initializer for a byte array.static String
toByteArray
(byte[] buf, int ofs, int len) Returns a string which can be written to a Java source file as part of a static initializer for a byte array.static String
toHex
(byte[] buf) static String
toHex
(byte[] buf, int ofs, int len)
-
Field Details
-
hexchars
public static final char[] hexchars
-
-
Constructor Details
-
Hexdump
public Hexdump()
-
-
Method Details
-
toHex
-
toHex
-
toAscii
-
toAscii
-
format
-
format
-
print
public static void print(byte[] buf) -
print
public static void print(byte[] buf, int width) -
print
-
print
-
toByteArray
Returns a string which can be written to a Java source file as part of a static initializer for a byte array. Returns data in the format 0xAB, 0xCD, .... use like: javafile.print("byte[] data = {") javafile.print(Hexdump.toByteArray(data)); javafile.println("};"); -
toByteArray
Returns a string which can be written to a Java source file as part of a static initializer for a byte array. Returns data in the format 0xAB, 0xCD, .... use like: javafile.print("byte[] data = {") javafile.print(Hexdump.toByteArray(data)); javafile.println("};");
-