Class ByteArray

java.lang.Object
org.bitcoinj.base.internal.ByteArray
All Implemented Interfaces:
Comparable<ByteArray>
Direct Known Subclasses:
AesKey, Bech32.Bech32Bytes

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

    • bytes

      protected final byte[] bytes
  • Constructor Details

    • ByteArray

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

    • bytes

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

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

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

      public boolean equals(Object o)
      Overrides:
      equals in class 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 Comparable<ByteArray>
      Parameters:
      o -
      Returns: