public static void setVarInt(ByteBuffer buffer, int value) {
        while ((value & 0xFFFFFF80) != 0) {
            buffer.put((byte) ((value & 0x7F) | 0x80));
            value >>>= 7;
        }
        buffer.put((byte) (value & 0x7F));
    }
Write varint to given output stream.

@param buffer non-null byte buffer
@param value  integer value
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseByteUtils.java