java.lang.Object
tools.jackson.dataformat.protobuf.ProtobufUtil

public class ProtobufUtil extends Object
  • 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)