Class ByteArray


  • public final class ByteArray
    extends Object
    Immutable array of bytes.
    • Method Detail

      • from

        public static ByteArray from​(byte[] a)
        Creates an instance of this class.
        Parameters:
        a - an array of bytes
        Returns:
        a new instance
      • get

        public byte get​(int index)
        Return the byte at a position.
        Parameters:
        index - the position
        Returns:
        a byte
      • length

        public int length()
        Returns the array length
        Returns:
        the length
      • array

        public byte[] array()
        Returns copy of the array.
        Returns:
        an array of bytes
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object