public static UUID uuid(byte[] bytes, int offset) { _checkUUIDByteArray(bytes, offset); return new UUID(gatherLong(bytes, offset), gatherLong(bytes, offset+8)); }
/** * Factory method for constructing {@link java.util.UUID} instance from given * 16 bytes. * NOTE: since absolutely no validation is done for contents, this method should * usually not be used, unless contents are known to be valid. */ public static UUID uuid(byte[] bytes) { _checkUUIDByteArray(bytes, 0); long l1 = gatherLong(bytes, 0); long l2 = gatherLong(bytes, 8); return new UUID(l1, l2); }
public static void toByteArray(UUID uuid, byte[] buffer, int offset) { _checkUUIDByteArray(buffer, offset); long hi = uuid.getMostSignificantBits(); long lo = uuid.getLeastSignificantBits(); _appendInt((int) (hi >> 32), buffer, offset); _appendInt((int) hi, buffer, offset+4); _appendInt((int) (lo >> 32), buffer, offset+8); _appendInt((int) lo, buffer, offset+12); }
/** * Factory method for constructing {@link java.util.UUID} instance from given * 16 bytes. * NOTE: since absolutely no validation is done for contents, this method should * only be used if contents are known to be valid. */ public static UUID uuid(byte[] bytes) { _checkUUIDByteArray(bytes, 0); long l1 = gatherLong(bytes, 0); long l2 = gatherLong(bytes, 8); return new UUID(l1, l2); }
/** * Factory method for constructing {@link java.util.UUID} instance from given * 16 bytes. * NOTE: since absolutely no validation is done for contents, this method should * only be used if contents are known to be valid. * * @param bytes Array that contains sequence of 16 bytes that contain a valid UUID * @param offset Offset of the first of 16 bytes */ public static UUID uuid(byte[] bytes, int offset) { _checkUUIDByteArray(bytes, offset); return new UUID(gatherLong(bytes, offset), gatherLong(bytes, offset+8)); }
public static void toByteArray(UUID uuid, byte[] buffer, int offset) { _checkUUIDByteArray(buffer, offset); long hi = uuid.getMostSignificantBits(); long lo = uuid.getLeastSignificantBits(); _appendInt((int) (hi >> 32), buffer, offset); _appendInt((int) hi, buffer, offset+4); _appendInt((int) (lo >> 32), buffer, offset+8); _appendInt((int) lo, buffer, offset+12); }