public abstract class PrefixedChecksummedBytes extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<PrefixedChecksummedBytes>
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.
Modifier and Type | Field and Description |
---|---|
protected byte[] |
bytes |
protected NetworkParameters |
params |
Modifier | Constructor and Description |
---|---|
protected |
PrefixedChecksummedBytes(NetworkParameters params,
byte[] bytes) |
Modifier and Type | Method and Description |
---|---|
PrefixedChecksummedBytes |
clone()
This implementation narrows the return type to
PrefixedChecksummedBytes
and allows subclasses to throw CloneNotSupportedException even though it
is never thrown by this implementation. |
int |
compareTo(PrefixedChecksummedBytes o)
This implementation uses an optimized Google Guava method to compare
bytes . |
boolean |
equals(java.lang.Object o) |
NetworkParameters |
getParameters() |
int |
hashCode() |
protected final transient NetworkParameters params
protected final byte[] bytes
protected PrefixedChecksummedBytes(NetworkParameters params, byte[] bytes)
public final NetworkParameters getParameters()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public PrefixedChecksummedBytes clone() throws java.lang.CloneNotSupportedException
PrefixedChecksummedBytes
and allows subclasses to throw CloneNotSupportedException
even though it
is never thrown by this implementation.clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public int compareTo(PrefixedChecksummedBytes o)
bytes
.compareTo
in interface java.lang.Comparable<PrefixedChecksummedBytes>