private int ensureCapacity(int datalen) {
        int newcount = count + datalen;
        if (newcount > buf.length) {
            buf = Arrays.copyOf(buf, Math.max(buf.length << 1, newcount));
        }
        return newcount;
    }
Creates a new byte array output stream, with a buffer capacity of the
specified size, in bytes.

@param size the initial size.
@exception IllegalArgumentException if size is negative.
clickhouse-data/src/main/java/com/clickhouse/data/format/tsv/FastByteArrayOutputStream.java