com.fasterxml.jackson.dataformat.protobuf

## Class ProtobufUtil

- java.lang.Object
- - com.fasterxml.jackson.dataformat.protobuf.ProtobufUtil

-     public class ProtobufUtil
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `SECONDARY_BUFFER_LENGTH`
    `static int[]` | `sUtf8UnitLengths`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProtobufUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `static int` | `appendLengthLength(int len, byte[] buffer, int ptr)` NOTE: caller MUST ensure buffer has room for at least 5 bytes
    `static byte[]` | `lengthAsBytes(int len)`
    `static int` | `lengthLength(int len)`
    `static int` | `zigzagDecode(int encoded)`
    `static long` | `zigzagDecode(long encoded)`
    `static int` | `zigzagEncode(int input)`
    `static long` | `zigzagEncode(long input)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SECONDARY_BUFFER_LENGTH

          public static final int SECONDARY_BUFFER_LENGTH

      See Also:
        Constant Field Values

    - #### sUtf8UnitLengths

          public static final int[] sUtf8UnitLengths

  - ### Constructor Detail

    - #### ProtobufUtil

          public ProtobufUtil()

  - ### Method Detail

    - #### 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)

Copyright © 2016 FasterXML. All rights reserved.