java.lang.Object
nl.andrewl.concord_core.msg.MessageUtils
Utility class which provides method for serializing and deserializing complex
data types.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
static int
getByteSize
(Object... objects) static int
Gets the number of bytes that the given string will occupy when it is serialized.static int
getByteSize
(String... strings) Gets the number of bytes that all the given strings will occupy when serialized with a length-prefix encoding.static int
getByteSize
(Message msg) static <T extends Message>
intgetByteSize
(T[] items)
-
Field Details
-
UUID_BYTES
public static final int UUID_BYTES- See Also:
-
ENUM_BYTES
public static final int ENUM_BYTES- See Also:
-
-
Constructor Details
-
MessageUtils
public MessageUtils()
-
-
Method Details
-
getByteSize
Gets the number of bytes that the given string will occupy when it is serialized.- Parameters:
s
- The string. This may be null.- Returns:
- The number of bytes used to serialize the string.
-
getByteSize
Gets the number of bytes that all the given strings will occupy when serialized with a length-prefix encoding.- Parameters:
strings
- The set of strings.- Returns:
- The total byte size.
-
getByteSize
-
getByteSize
-
getByteSize
-
getByteSize
-