Class Types

java.lang.Object
uk.co.real_logic.sbe.otf.Types

public class Types extends Object
Utility functions for applying over encoded types to help with on-the-fly (OTF) decoding.
  • Constructor Details

    • Types

      public Types()
  • Method Details

    • getInt

      public static int getInt(DirectBuffer buffer, int index, PrimitiveType type, ByteOrder byteOrder)
      Get an integer value from a buffer at a given index for a PrimitiveType.
      Parameters:
      buffer - from which to read.
      index - at which the integer should be read.
      type - of the integer encoded in the buffer.
      byteOrder - of the integer in the buffer.
      Returns:
      the value of the encoded integer.
    • getLong

      public static long getLong(DirectBuffer buffer, int index, Encoding encoding)
      Get a long value from a buffer at a given index for a given Encoding.
      Parameters:
      buffer - from which to read.
      index - at which the integer should be read.
      encoding - of the value.
      Returns:
      the value of the encoded long.
    • appendAsString

      public static void appendAsString(StringBuilder sb, DirectBuffer buffer, int index, Encoding encoding)
      Append an encoding as a String to a StringBuilder.
      Parameters:
      sb - to append the encoding to.
      buffer - containing the encoded value.
      index - at which the encoded value exists.
      encoding - representing the encoded value.
    • appendAsJsonString

      public static void appendAsJsonString(StringBuilder sb, DirectBuffer buffer, int index, Encoding encoding)
      Append an encoding as a Json String to a StringBuilder.
      Parameters:
      sb - to append the encoding to.
      buffer - containing the encoded value.
      index - at which the encoded value exists.
      encoding - representing the encoded value.
    • appendAsJsonString

      public static void appendAsJsonString(StringBuilder sb, PrimitiveValue value, Encoding encoding)
      Append a value as a Json String to a StringBuilder.
      Parameters:
      sb - to append the value to.
      value - to append.
      encoding - representing the encoded value.