public static int readVarint(ByteBuffer buffer) {
        int value = readUnsignedVarint(buffer);
        return (value >>> 1) ^ -(value & 1);
    }
Read an integer stored in variable-length format using zig-zag decoding from
<a href="http://code.google.com/apis/protocolbuffers/docs/encoding.html"> Google Protocol Buffers</a>.

@param buffer The buffer to read from
@return The integer read

@throws IllegalArgumentException if variable-length value does not terminate after 5 bytes have been read
clients/src/main/java/org/apache/kafka/common/utils/ByteUtils.java