package protocolsupport.protocol.serializer;

import java.util.UUID;

import io.netty.buffer.ByteBuf;

public class UUIDSerializer {

	public static UUID readUUID2L(ByteBuf from) {
		return new UUID(from.readLong(), from.readLong());
	}

	public static UUID readUUID4I(ByteBuf from) {
		return new UUID((from.readInt() << 32) | from.readInt(), (from.readInt() << 32) | from.readInt());
	}

	public static void writeUUID2L(ByteBuf to, UUID uuid) {
		to.writeLong(uuid.getMostSignificantBits());
		to.writeLong(uuid.getLeastSignificantBits());
	}

	public static void writeUUID4I(ByteBuf to, UUID uuid) {
		long most = uuid.getMostSignificantBits();
		long least = uuid.getLeastSignificantBits();
		to.writeInt((int) (most >>> 32));
		to.writeInt((int) most);
		to.writeInt((int) (least >>> 32));
		to.writeInt((int) least);
	}

}

@@ -297,16 +297,17 @@
 w UUID((
+(
 from.rea
@@ -299,37 +299,46 @@
 UUID(((from.read
+Unsigned
 Int()
+)
  %3C%3C 32) %7C from.r
@@ -336,24 +336,32 @@
  %7C from.read
+Unsigned
 Int(), (from
@@ -361,24 +361,32 @@
 , (from.read
+Unsigned
 Int() %3C%3C 32)
@@ -397,16 +397,24 @@
 rom.read
+Unsigned
 Int());%0A

Fix uuid4i serializer