Class Hexdump


  • public class Hexdump
    extends java.lang.Object
    • Field Summary

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

      Constructors 
      Constructor Description
      Hexdump()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String format​(byte[] buf)  
      static java.lang.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, java.io.PrintStream out)  
      static void print​(byte[] buf, java.io.PrintStream out)  
      static java.lang.String toAscii​(byte[] buf)  
      static java.lang.String toAscii​(byte[] buf, int ofs, int len)  
      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.
      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.
      static java.lang.String toHex​(byte[] buf)  
      static java.lang.String toHex​(byte[] buf, int ofs, int len)  
      • Methods inherited from class java.lang.Object

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

      • hexchars

        public static final char[] hexchars
    • Constructor Detail

      • Hexdump

        public Hexdump()
    • Method Detail

      • toHex

        public static java.lang.String toHex​(byte[] buf)
      • toHex

        public static java.lang.String toHex​(byte[] buf,
                                             int ofs,
                                             int len)
      • 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("};");
      • 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("};");