Archived
0

clean classes

This commit is contained in:
2018-08-16 00:33:56 +03:00
parent f3cff24fa4
commit 54992d8b59
3 changed files with 0 additions and 31 deletions

View File

@@ -1,5 +0,0 @@
package mc.core.serialization;
public interface Deserializer<T> {
T deserialize (byte[] bytes);
}

View File

@@ -1,5 +0,0 @@
package mc.core.serialization;
public interface Serializer<T> {
byte[] serialize (T t);
}

View File

@@ -1,21 +0,0 @@
package mc.core.utils;
import java.nio.ByteBuffer;
import java.util.UUID;
public class UuidUtils {
public static UUID asUuid(byte[] bytes) {
ByteBuffer bb = ByteBuffer.wrap(bytes);
long firstLong = bb.getLong();
long secondLong = bb.getLong();
return new UUID(firstLong, secondLong);
}
public static byte[] asBytes(UUID uuid) {
ByteBuffer bb = ByteBuffer.wrap(new byte[16]);
bb.putLong(uuid.getMostSignificantBits());
bb.putLong(uuid.getLeastSignificantBits());
return bb.array();
}
}