public class VersionedChecksummedBytes extends Object implements Serializable, Cloneable, Comparable<VersionedChecksummedBytes>
In Bitcoin the following format is often used to represent some type of key:
[one version byte] [data bytes] [4 checksum bytes]
and the result is then Base58 encoded. This format is used for addresses, and private keys exported using the dumpprivkey command.
Modifier and Type | Field and Description |
---|---|
protected byte[] |
bytes |
protected int |
version |
Modifier | Constructor and Description |
---|---|
protected |
VersionedChecksummedBytes(int version,
byte[] bytes) |
protected |
VersionedChecksummedBytes(String encoded) |
Modifier and Type | Method and Description |
---|---|
VersionedChecksummedBytes |
clone()
This implementation narrows the return type to
VersionedChecksummedBytes
and allows subclasses to throw CloneNotSupportedException even though it
is never thrown by this implementation. |
int |
compareTo(VersionedChecksummedBytes o)
This implementation uses an optimized Google Guava method to compare
bytes . |
boolean |
equals(Object o) |
int |
getVersion()
Returns the "version" or "header" byte: the first byte of the data.
|
int |
hashCode() |
String |
toBase58()
Returns the base-58 encoded String representation of this
object, including version and checksum bytes.
|
String |
toString() |
protected VersionedChecksummedBytes(String encoded) throws AddressFormatException
AddressFormatException
protected VersionedChecksummedBytes(int version, byte[] bytes)
public final String toBase58()
public VersionedChecksummedBytes clone() throws CloneNotSupportedException
VersionedChecksummedBytes
and allows subclasses to throw CloneNotSupportedException
even though it
is never thrown by this implementation.clone
in class Object
CloneNotSupportedException
public int compareTo(VersionedChecksummedBytes o)
bytes
.compareTo
in interface Comparable<VersionedChecksummedBytes>
public int getVersion()
Copyright © 2016. All rights reserved.