public class SessionTag extends SimpleDataStructure
| Modifier and Type | Field and Description |
|---|---|
static int |
BYTE_LENGTH |
_data| Constructor and Description |
|---|
SessionTag() |
SessionTag(boolean create) |
SessionTag(byte[] val) |
| Modifier and Type | Method and Description |
|---|---|
int |
hashCode()
SessionTags are generated both locally and by peers, in quantity,
and are used as keys in several datastructures (see TransientSessionKeyManager),
so we use a secure hashCode function.
|
int |
length()
The legal length of the byte array in this data structure
|
void |
readBytes(InputStream in)
Sets the data.
|
void |
setData(byte[] data)
Sets the data.
|
calculateHash, equals, fromBase64, fromByteArray, getData, toBase64, toByteArray, toString, writeBytesreadpublic static final int BYTE_LENGTH
public SessionTag()
public SessionTag(boolean create)
create - if true, instantiate the data array and fill it with random data.public SessionTag(byte[] val)
public int length()
SimpleDataStructurelength in class SimpleDataStructurepublic void setData(byte[] data)
SimpleDataStructuresetData in class SimpleDataStructuredata - of correct length, or nullpublic void readBytes(InputStream in) throws DataFormatException, IOException
SimpleDataStructurereadBytes in interface DataStructurereadBytes in class SimpleDataStructurein - the stream to readDataFormatException - if the data is improperly formattedIOException - if there was a problem reading the streampublic int hashCode()
hashCode in class SimpleDataStructure