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> <groupId>nl.andrewl</groupId>
<artifactId>record-net</artifactId> <artifactId>record-net</artifactId>
<version>1.3.2</version> <version>1.3.3</version>
<properties> <properties>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>

View File

@ -56,6 +56,14 @@ public class MessageUtils {
public static int getByteSize(Serializer serializer, Object o) { public static int getByteSize(Serializer serializer, Object o) {
if (o instanceof Integer) { if (o instanceof Integer) {
return Integer.BYTES; 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) { } else if (o instanceof Long) {
return Long.BYTES; return Long.BYTES;
} else if (o instanceof String) { } else if (o instanceof String) {