The first form of the constructor creates a pure identifier that is unique with respect to the host on which it is generated. This UID
is unique under the following conditions: a) the machine takes more than one second to reboot, and b) the machine's clock is never set backward. In order to construct a UID
that is globally unique, simply pair a UID
with an InetAddress
.
The second form of the constructor creates a well-known UID
. There are 216 -1 such possible well-known IDs. An ID generated via this constructor will not clash with any ID generated via the default UID
constructor which generates a genuinely unique identifier with respect to this host.
The methods hashCode
, equals
, and toString
are defined for UIDs
. Two UIDs
are considered equal if they have the same contents.
The method write
writes the UID
to the output stream.
The method read
constructs a UID
whose contents is read from the specified input stream.