Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5023614

UUID needs methods to get most/leastSigBits and write to DataOutput

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Understanding:
      Fix Understood
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      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)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rmandalasunw Ranjith Mandala (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: