public ClickHouseByteBuffer setLength(int newLength) {
        this.length = newLength < 0 ? 0 : newLength;
        return this;
    }
Sets new length.

@param newLength new length, negative number is treated as zero
@return this byte buffer
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseByteBuffer.java