Added more type support.

This commit is contained in:
Andrew Lalis 2022-07-07 12:52:25 +02:00
parent 8e347f0761
commit a9fbcb8c2e
2 changed files with 9 additions and 1 deletions

View File

@ -6,7 +6,7 @@
<groupId>nl.andrewl</groupId>
<artifactId>record-net</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<properties>
<maven.compiler.source>17</maven.compiler.source>

View File

@ -56,6 +56,14 @@ public class MessageUtils {
public static int getByteSize(Serializer serializer, Object o) {
if (o instanceof Integer) {
return Integer.BYTES;
} else if (o instanceof Float) {
return Float.BYTES;
} else if (o instanceof Byte) {
return Byte.BYTES;
} else if (o instanceof Double) {
return Double.BYTES;
} else if (o instanceof Short) {
return Short.BYTES;
} else if (o instanceof Long) {
return Long.BYTES;
} else if (o instanceof String) {