oracle.ide.util
Class GuidGen
java.lang.Object
oracle.ide.util.GuidGen
- public class GuidGen
- extends java.lang.Object
This static class provided utilties for generation and manipulation of DFC style Globally Unique Identifiers, using the original HP/OSF UUID reference implemenation as a basis. Since the Java runtime does not allow access to the full IEEE 802 48-bit ethernet address of a host (if indeed there is one) this implementation attempts to use the 32-bit IP number in the first instance, and defaults to the sample pseudo-unique algorithm if the IP address is not available.
A native method-based extension will be provided in due course to provide true GUID values.
Field Summary |
static int |
GUID_LENGTH
The length of a raw GUID byte array |
Method Summary |
static void |
byteToHex(java.lang.StringBuffer buff, byte byteVal)
Coverts the specified byte value to a hexadecimal representaion, and appends this to the specified String buffer. |
static byte[] |
toRaw(java.lang.String strUUID)
Convert a standard UUID string representation to a raw 16-byte UUID. |
static java.lang.String |
toString(byte[] uuidRaw)
Convert a raw UUID to a standard string representation. |
static byte[] |
uuidCreate()
Generate a raw 128-bit (16-byte) UUID. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GUID_LENGTH
public static final int GUID_LENGTH
- The length of a raw GUID byte array
- See Also:
- Constant Field Values
GuidGen
public GuidGen()
uuidCreate
public static byte[] uuidCreate()
- Generate a raw 128-bit (16-byte) UUID.
-
- Returns:
- a raw 16-byte UUID
toString
public static java.lang.String toString(byte[] uuidRaw)
- Convert a raw UUID to a standard string representation.
-
- Parameters:
uuidRaw
- A raw 16-byte UUID
- Returns:
- String representation of the UUID. Null on failure.
toRaw
public static byte[] toRaw(java.lang.String strUUID)
- Convert a standard UUID string representation to a raw 16-byte UUID.
-
- Parameters:
strUUID
- A standard string representation of a UUID
- Returns:
- a raw 16-byte UUID. Null on failure
byteToHex
public static void byteToHex(java.lang.StringBuffer buff,
byte byteVal)
- Coverts the specified byte value to a hexadecimal representaion, and appends this to the specified String buffer.
-
- Parameters:
buff
- the StringBuffer
byteVal
- the byte value to be converted.
Copyright © 1997, 2004, Oracle. All rights reserved.