Serializable
, DataStructure
public class Signature extends SimpleDataStructure
Modifier and Type | Field | Description |
---|---|---|
static byte[] |
FAKE_SIGNATURE |
Deprecated.
to be removed
|
static int |
SIGNATURE_BYTES |
40
|
_data
Constructor | Description |
---|---|
Signature() |
|
Signature(byte[] data) |
|
Signature(SigType type) |
Unknown type not allowed as we won't know the length to read in the data.
|
Signature(SigType type,
byte[] data) |
Should we allow an unknown type here?
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object obj) |
Warning - this returns true for two different classes with the same size
and same data, e.g.
|
SigType |
getType() |
|
int |
hashCode() |
We assume the data has enough randomness in it, so use the first 4 bytes for speed.
|
int |
length() |
The legal length of the byte array in this data structure
|
String |
toString() |
read
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
calculateHash, fromBase64, fromByteArray, getData, readBytes, setData, toBase64, toByteArray, writeBytes
public static final int SIGNATURE_BYTES
@Deprecated public static final byte[] FAKE_SIGNATURE
public Signature()
public Signature(SigType type)
type
- non-nullpublic Signature(byte[] data)
public Signature(SigType type, byte[] data)
type
- non-nullpublic int length()
SimpleDataStructure
length
in class SimpleDataStructure
public SigType getType()
public String toString()
toString
in class SimpleDataStructure
public int hashCode()
SimpleDataStructure
hashCode
in class SimpleDataStructure
public boolean equals(Object obj)
SimpleDataStructure
equals
in class SimpleDataStructure