HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🤩
개발
/
Java
Java
/
💯
Java 기본
/활용 (API)/
UUID

UUID

 

UUID → Byte

public byte[] getIdAsByte(UUID uuid) { ByteBuffer bb = ByteBuffer.wrap(new byte[16]); bb.putLong(uuid.getMostSignificantBits()); bb.putLong(uuid.getLeastSignificantBits()); return bb.array(); }

Byte → UUID

ByteBuffer b = ByteBuffer.wrap(byteArray); UUID uuid = new UUID(b.getLong(), b.getLong());