Remove unused imports, add string support.
This commit is contained in:
parent
7890c2cd19
commit
9815450b83
|
@ -3,7 +3,6 @@ package com.andrewlalis.record_net;
|
|||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
|
|
@ -86,6 +86,9 @@ public class RecordMappedSerializer implements RecordSerializer {
|
|||
if (type.equals(UUID.class)) {
|
||||
return IOUtil.readUUID(dIn);
|
||||
}
|
||||
if (type.equals(String.class)) {
|
||||
return IOUtil.readString(dIn);
|
||||
}
|
||||
if (type.isPrimitive()) {
|
||||
return IOUtil.readPrimitive(type, dIn);
|
||||
}
|
||||
|
@ -127,8 +130,12 @@ public class RecordMappedSerializer implements RecordSerializer {
|
|||
IOUtil.writeEnum((Enum<?>) obj, dOut);
|
||||
} else if (type.equals(UUID.class)) {
|
||||
IOUtil.writeUUID((UUID) obj, dOut);
|
||||
} else {
|
||||
} else if (type.equals(String.class)) {
|
||||
IOUtil.writeString((String) obj, dOut);
|
||||
} else if (type.isPrimitive()) {
|
||||
IOUtil.writePrimitive(obj, dOut);
|
||||
} else {
|
||||
throw new UnsupportedMessageTypeException(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue