Class PrefixedChecksummedBytes

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Direct Known Subclasses:
    Address, BIP38PrivateKey, DumpedPrivateKey

    public abstract class PrefixedChecksummedBytes
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable

    The following format is often used to represent some type of data (e.g. key or hash of key):

     [prefix] [data bytes] [checksum]
     

    and the result is then encoded with some variant of base. This format is most commonly used for addresses and private keys exported using Bitcoin Core's dumpprivkey command.

    See Also:
    Serialized Form
    • Field Detail

      • bytes

        protected final byte[] bytes
    • Constructor Detail

      • PrefixedChecksummedBytes

        protected PrefixedChecksummedBytes​(NetworkParameters params,
                                           byte[] bytes)
    • Method Detail

      • getParameters

        public final NetworkParameters getParameters()
        Returns:
        network this data is valid for
      • hashCode

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

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • clone

        public PrefixedChecksummedBytes clone()
                                       throws java.lang.CloneNotSupportedException
        This implementation narrows the return type to PrefixedChecksummedBytes and allows subclasses to throw CloneNotSupportedException even though it is never thrown by this implementation.
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException