Class Hexdump

java.lang.Object
org.freedesktop.dbus.utils.Hexdump

public final class Hexdump extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final char[]
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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, boolean _spaces)
     
    static String
    toHex(byte[] _buf, int _ofs, int _len, boolean _spaces)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • HEX_CHARS

      public static final char[] HEX_CHARS
  • Constructor Details

    • Hexdump

      private Hexdump()
  • Method Details

    • toHex

      public static String toHex(byte[] _buf)
    • toHex

      public static String toHex(byte[] _buf, boolean _spaces)
    • toHex

      public static String toHex(byte[] _buf, int _ofs, int _len, boolean _spaces)
    • toAscii

      public static String toAscii(byte[] _buf)
    • toAscii

      public static String toAscii(byte[] _buf, int _ofs, int _len)
    • format

      public static String format(byte[] _buf)
    • format

      public static 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, PrintStream _out)
    • print

      public static void print(byte[] _buf, PrintStream _out)
    • toByteArray

      public 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. 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 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