Name: rmT116609 Date: 03/30/2004
A DESCRIPTION OF THE REQUEST :
The new java.util.UUID class in 1.5 beta 1 has a few ways to construct a UUID from 128 bits of raw data, including:
public UUID(long mostSigBits, long leastSigBits);
public UUID(java.io.DataInput in) throws IOException; // reads two longs
There is also a private constructor which takes an array of 16 bytes. It would be nice if this were public.
Currently, there is no corresponding way to get the raw data from an existing instance. UUID should have methods such as the following:
public long getMostSignificanttBits();
public long getLeastSignificantBits();
public byte[] getData();
public void write(java.io.DataOutput);
JUSTIFICATION :
We are using a custom protocol to communicate between and java server and a C++ client. We would prefer to marshall and unmarshall UUIDs using their underlying 128 bit values rather than converting them to strings. The new UUID class gives us a way to unmarshall an instance from 128 bits of raw data, but no easy way to marshall an instance.
(Incident Review ID: 245647)
======================================================================
A DESCRIPTION OF THE REQUEST :
The new java.util.UUID class in 1.5 beta 1 has a few ways to construct a UUID from 128 bits of raw data, including:
public UUID(long mostSigBits, long leastSigBits);
public UUID(java.io.DataInput in) throws IOException; // reads two longs
There is also a private constructor which takes an array of 16 bytes. It would be nice if this were public.
Currently, there is no corresponding way to get the raw data from an existing instance. UUID should have methods such as the following:
public long getMostSignificanttBits();
public long getLeastSignificantBits();
public byte[] getData();
public void write(java.io.DataOutput);
JUSTIFICATION :
We are using a custom protocol to communicate between and java server and a C++ client. We would prefer to marshall and unmarshall UUIDs using their underlying 128 bit values rather than converting them to strings. The new UUID class gives us a way to unmarshall an instance from 128 bits of raw data, but no easy way to marshall an instance.
(Incident Review ID: 245647)
======================================================================
- links to
-
Review openjdk/jdk/1465