Class ByteArray

  • All Implemented Interfaces:
    java.lang.Comparable<ByteArray>
    Direct Known Subclasses:
    AesKey

    public class ByteArray
    extends java.lang.Object
    implements java.lang.Comparable<ByteArray>
    An effectively-immutable byte array.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected byte[] bytes  
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteArray​(byte[] bytes)
      Wrapper for a byte[]
    • Field Detail

      • bytes

        protected final byte[] bytes
    • Constructor Detail

      • ByteArray

        public ByteArray​(byte[] bytes)
        Wrapper for a byte[]
        Parameters:
        bytes - byte data to wrap
    • Method Detail

      • bytes

        public byte[] bytes()
        Returns:
        the key bytes
      • formatHex

        public java.lang.String formatHex()
        Returns:
        the bytes as a hex-formatted string
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        Returns:
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o -
        Returns:
      • compareTo

        public int compareTo​(ByteArray o)

        For ByteArray this is a byte-by-byte, unsigned comparison.

        Specified by:
        compareTo in interface java.lang.Comparable<ByteArray>
        Parameters:
        o -
        Returns: