Package org.bitcoinj.core
Class PrefixedChecksummedBytes
- java.lang.Object
-
- org.bitcoinj.core.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 Summary
Fields Modifier and Type Field Description protected byte[]
bytes
protected NetworkParameters
params
-
Constructor Summary
Constructors Modifier Constructor Description protected
PrefixedChecksummedBytes(NetworkParameters params, byte[] bytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrefixedChecksummedBytes
clone()
This implementation narrows the return type toPrefixedChecksummedBytes
and allows subclasses to throwCloneNotSupportedException
even though it is never thrown by this implementation.boolean
equals(java.lang.Object o)
NetworkParameters
getParameters()
int
hashCode()
-
-
-
Field Detail
-
params
protected final transient NetworkParameters params
-
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 classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
clone
public PrefixedChecksummedBytes clone() throws java.lang.CloneNotSupportedException
This implementation narrows the return type toPrefixedChecksummedBytes
and allows subclasses to throwCloneNotSupportedException
even though it is never thrown by this implementation.- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
-