Class Hex

  • All Implemented Interfaces:
    java.lang.CharSequence

    public final class Hex
    extends java.lang.Object
    implements java.lang.CharSequence
    The hexadecimal CharSequence representation of a byte array. The digits a-f will be represented by lower case letters.

    Example:

     assertEquals(
         new Hex(new byte[{0x01, 0x23, 0x45, 0x67, (byte) 0x89, (byte) 0xab, (byte) 0xcd, (byte) 0xef }).toString(),
         "0123456789abcdef");
     
    • Constructor Summary

      Constructors 
      Constructor Description
      Hex​(byte[] binaryData)  
      Hex​(byte[] binaryData, int start, int end)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      char charAt​(int index)  
      int length()  
      java.lang.CharSequence subSequence​(int start, int end)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.CharSequence

        chars, codePoints
    • Constructor Detail

      • Hex

        public Hex​(byte[] binaryData)
      • Hex

        public Hex​(byte[] binaryData,
                   int start,
                   int end)
    • Method Detail

      • length

        public int length()
        Specified by:
        length in interface java.lang.CharSequence
      • charAt

        public char charAt​(int index)
        Specified by:
        charAt in interface java.lang.CharSequence
      • subSequence

        public java.lang.CharSequence subSequence​(int start,
                                                  int end)
        Specified by:
        subSequence in interface java.lang.CharSequence
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.CharSequence
        Overrides:
        toString in class java.lang.Object