Module concord_core

Class MessageUtils

java.lang.Object
nl.andrewl.concord_core.msg.MessageUtils

public class MessageUtils extends Object
Utility class which provides method for serializing and deserializing complex data types.
  • Field Details

  • Constructor Details

    • MessageUtils

      public MessageUtils()
  • Method Details

    • getByteSize

      public static int getByteSize(String s)
      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

      public static int getByteSize(String... strings)
      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

      public static int getByteSize(Message msg)
    • getByteSize

      public static <T extends Message> int getByteSize(T[] items)
    • getByteSize

      public static int getByteSize(Object o)
    • getByteSize

      public static int getByteSize(Object... objects)