Class ProtobufUtil
java.lang.Object
tools.jackson.dataformat.protobuf.ProtobufUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]allocSecondary(byte[] curr) While we could get all fancy on allocating secondary buffer (after initial one), let's start with very simple strategy of medium-length buffer.static intappendLengthLength(int len, byte[] buffer, int ptr) NOTE: caller MUST ensure buffer has room for at least 5 bytesstatic byte[]lengthAsBytes(int len) static intlengthLength(int len) static intzigzagDecode(int encoded) static longzigzagDecode(long encoded) static intzigzagEncode(int input) static longzigzagEncode(long input)
-
Field Details
-
SECONDARY_BUFFER_LENGTH
public static final int SECONDARY_BUFFER_LENGTH- See Also:
-
sUtf8UnitLengths
public static final int[] sUtf8UnitLengths
-
-
Constructor Details
-
ProtobufUtil
public ProtobufUtil()
-
-
Method Details
-
allocSecondary
public static byte[] allocSecondary(byte[] curr) While we could get all fancy on allocating secondary buffer (after initial one), let's start with very simple strategy of medium-length buffer. -
lengthLength
public static int lengthLength(int len) -
appendLengthLength
public static int appendLengthLength(int len, byte[] buffer, int ptr) NOTE: caller MUST ensure buffer has room for at least 5 bytes -
lengthAsBytes
public static byte[] lengthAsBytes(int len) -
zigzagEncode
public static int zigzagEncode(int input) -
zigzagDecode
public static int zigzagDecode(int encoded) -
zigzagEncode
public static long zigzagEncode(long input) -
zigzagDecode
public static long zigzagDecode(long encoded)
-