Skip to content

ExtraData

Thomas Schwotzer edited this page Aug 30, 2021 · 1 revision
SharkPeer sharkPeer ...; // see previous sections
sharkPeer.putExtra("example_key", "exampleData".getBytes());
byte[] data = sharkPeer.getExtra("example_key");

This concept does not require any further detailed explanations. Arbitrary byte arrays can be stored with a key with this SharkPeer.

Comparision

Two peer can be compared by calling samePeer(). It returns true if both peer have the same ID. This functions only works if an ASAPPeer instance is set.