Package org.freedesktop.dbus.utils
Class Hexdump
- java.lang.Object
-
- org.freedesktop.dbus.utils.Hexdump
-
public final class Hexdump extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static char[]HEX_CHARS
-
Constructor Summary
Constructors Modifier Constructor Description privateHexdump()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringformat(byte[] _buf)static java.lang.Stringformat(byte[] _buf, int _width)static voidprint(byte[] _buf)static voidprint(byte[] _buf, int _width)static voidprint(byte[] _buf, int _width, java.io.PrintStream _out)static voidprint(byte[] _buf, java.io.PrintStream _out)static java.lang.StringtoAscii(byte[] _buf)static java.lang.StringtoAscii(byte[] _buf, int _ofs, int _len)static java.lang.StringtoByteArray(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 java.lang.StringtoByteArray(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 java.lang.StringtoHex(byte[] _buf)static java.lang.StringtoHex(byte[] _buf, boolean _spaces)static java.lang.StringtoHex(byte[] _buf, int _ofs, int _len, boolean _spaces)
-
-
-
Method Detail
-
toHex
public static java.lang.String toHex(byte[] _buf)
-
toHex
public static java.lang.String toHex(byte[] _buf, boolean _spaces)
-
toHex
public static java.lang.String toHex(byte[] _buf, int _ofs, int _len, boolean _spaces)
-
toAscii
public static java.lang.String toAscii(byte[] _buf)
-
toAscii
public static java.lang.String toAscii(byte[] _buf, int _ofs, int _len)
-
format
public static java.lang.String format(byte[] _buf)
-
format
public static java.lang.String format(byte[] _buf, int _width)
-
print
public static void print(byte[] _buf)
-
print
public static void print(byte[] _buf, int _width)
-
print
public static void print(byte[] _buf, int _width, java.io.PrintStream _out)
-
print
public static void print(byte[] _buf, java.io.PrintStream _out)
-
toByteArray
public static java.lang.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. Returns data in the format 0xAB, 0xCD, .... use like: javafile.print("byte[] data = {") javafile.print(Hexdump.toByteArray(data)); javafile.println("};"); * @param buf- Parameters:
_buf- buffer- Returns:
- string
-
toByteArray
public static java.lang.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. Returns data in the format 0xAB, 0xCD, .... use like: javafile.print("byte[] data = {") javafile.print(Hexdump.toByteArray(data)); javafile.println("};");- Parameters:
_buf- buffer_ofs- offset_len- length- Returns:
- string
-
-