From a9fbcb8c2ef4ccd9393c446f2d586f1abd1d5f96 Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Thu, 7 Jul 2022 12:52:25 +0200 Subject: [PATCH] Added more type support. --- pom.xml | 2 +- src/main/java/nl/andrewl/record_net/MessageUtils.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3367e21..fc6da13 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ nl.andrewl record-net - 1.3.2 + 1.3.3 17 diff --git a/src/main/java/nl/andrewl/record_net/MessageUtils.java b/src/main/java/nl/andrewl/record_net/MessageUtils.java index ac20360..5a277f2 100644 --- a/src/main/java/nl/andrewl/record_net/MessageUtils.java +++ b/src/main/java/nl/andrewl/record_net/MessageUtils.java @@ -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) {