public static void writeVarlong(long value, ByteBuffer buffer) {
        long v = (value << 1) ^ (value >> 63);
        writeUnsignedVarlong(v, buffer);
    }
Write the given integer following the variable-length zig-zag encoding from
<a href="http://code.google.com/apis/protocolbuffers/docs/encoding.html"> Google Protocol Buffers</a>
into the buffer.

@param value The value to write
@param buffer The buffer to write to
clients/src/main/java/org/apache/kafka/common/utils/ByteUtils.java