Package io.camunda.zeebe.msgpack.spec
Class MsgPackWriter
java.lang.Object
io.camunda.zeebe.msgpack.spec.MsgPackWriter
This class uses signed value semantics. That means, an integer 0xffff_ffff is treated as -1
instead of 2^33 - 1, etc.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetEncodedArrayHeaderLenght(int size) static intgetEncodedBinaryValueLength(int len) static intstatic intgetEncodedLongValueLength(long v) static intgetEncodedMapHeaderLenght(int size) static intgetEncodedStringHeaderLength(int len) static intgetEncodedStringLength(int len) intvoiduse this method if the map size is not known upfront.wrap(org.agrona.MutableDirectBuffer buffer, int offset) writeArrayHeader(int size) writeBinary(org.agrona.DirectBuffer data) writeBinary(org.agrona.DirectBuffer data, int offset, int length) writeBinaryHeader(int len) writeBoolean(boolean val) writeFloat(double value) Float is the term in the msgpack specwriteInteger(long v) Integer is the term in the msgpack spec for all natural numberswriteMapHeader(int size) writeNil()writeRaw(org.agrona.DirectBuffer buffer) writeRaw(org.agrona.DirectBuffer buff, int offset, int length) voidwriteReservedMapHeader(int offset, int size) does not change the writer's offsetwriteString(org.agrona.DirectBuffer bytes) writeString(org.agrona.DirectBuffer buff, int offset, int length) writeStringHeader(int len)
-
Constructor Details
-
MsgPackWriter
public MsgPackWriter()
-
-
Method Details
-
wrap
-
writeArrayHeader
-
writeMapHeader
-
reserveMapHeader
public void reserveMapHeader()use this method if the map size is not known upfront. Record the offset before calling this method and then usewriteReservedMapHeader(int, int)later. -
writeReservedMapHeader
public void writeReservedMapHeader(int offset, int size) does not change the writer's offset -
writeRaw
-
writeRaw
-
writeString
-
writeString
-
writeInteger
Integer is the term in the msgpack spec for all natural numbers- Parameters:
v- value to write- Returns:
- this object
-
writeStringHeader
-
writeBinary
-
writeBinary
-
writeBinaryHeader
-
writeBoolean
-
writeNil
-
writeFloat
Float is the term in the msgpack spec- Parameters:
value- to write- Returns:
- this object
-
getOffset
public int getOffset() -
getEncodedMapHeaderLenght
public static int getEncodedMapHeaderLenght(int size) -
getEncodedArrayHeaderLenght
public static int getEncodedArrayHeaderLenght(int size) -
getEncodedStringHeaderLength
public static int getEncodedStringHeaderLength(int len) -
getEncodedStringLength
public static int getEncodedStringLength(int len) -
getEncodedLongValueLength
public static int getEncodedLongValueLength(long v) -
getEncodedBooleanValueLength
public static int getEncodedBooleanValueLength() -
getEncodedBinaryValueLength
public static int getEncodedBinaryValueLength(int len)
-