This commit is contained in:
Felix Koppe
2024-12-09 01:53:18 +01:00
parent 6487bafed1
commit daa8c0bf9d

View File

@@ -14,7 +14,11 @@ public <T> T readObject(ByteBuffer data, Class<T> c) throws IOException
byte[] uuid = new byte[36];
data.get(uuid);
return (T) UUID.fromString(new String(uuid));
if(uuid.equals(new UUID(1, 1))) {
return null;
} else {
return (T) UUID.fromString(new String(uuid));
}
}
@Override
@@ -24,6 +28,8 @@ public void writeObject(ByteBuffer buffer, Object object) throws IOException
if(uuid != null) {
buffer.put(uuid.toString().getBytes());
} else {
buffer.put(new UUID(1, 1).toString().getBytes());
}
}
}