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.CloneableThe 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[]bytesprotected NetworkParametersparams
-
Constructor Summary
Constructors Modifier Constructor Description protectedPrefixedChecksummedBytes(NetworkParameters params, byte[] bytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrefixedChecksummedBytesclone()This implementation narrows the return type toPrefixedChecksummedBytesand allows subclasses to throwCloneNotSupportedExceptioneven though it is never thrown by this implementation.booleanequals(java.lang.Object o)NetworkParametersgetParameters()inthashCode()
-
-
-
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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
clone
public PrefixedChecksummedBytes clone() throws java.lang.CloneNotSupportedException
This implementation narrows the return type toPrefixedChecksummedBytesand allows subclasses to throwCloneNotSupportedExceptioneven though it is never thrown by this implementation.- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
-