Package uk.co.real_logic.sbe.otf
Class Types
java.lang.Object
uk.co.real_logic.sbe.otf.Types
Utility functions for applying over encoded types to help with on-the-fly (OTF) decoding.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendAsJsonString(StringBuilder sb, DirectBuffer buffer, int index, Encoding encoding) Append an encoding as a Json String to aStringBuilder.static voidappendAsJsonString(StringBuilder sb, PrimitiveValue value, Encoding encoding) Append a value as a Json String to aStringBuilder.static voidappendAsString(StringBuilder sb, DirectBuffer buffer, int index, Encoding encoding) Append an encoding as a String to aStringBuilder.static intgetInt(DirectBuffer buffer, int index, PrimitiveType type, ByteOrder byteOrder) Get an integer value from a buffer at a given index for aPrimitiveType.static longgetLong(DirectBuffer buffer, int index, Encoding encoding) Get a long value from a buffer at a given index for a givenEncoding.
-
Constructor Details
-
Types
public Types()
-
-
Method Details
-
getInt
Get an integer value from a buffer at a given index for aPrimitiveType.- 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
Get a long value from a buffer at a given index for a givenEncoding.- 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 aStringBuilder.- 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 aStringBuilder.- 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
Append a value as a Json String to aStringBuilder.- Parameters:
sb- to append the value to.value- to append.encoding- representing the encoded value.
-