@Override
    public byte[] asBinary(int length, Charset charset) {
        byte[] b = bytes;
        if (value != null && b == null) {
            bytes = b = value.getBytes(charset == null ? StandardCharsets.UTF_8 : charset);
        }

        if (b != null && b.length < length) {
            b = Arrays.copyOf(b, length);
        }
        return b;
    }
Update value of the given object or create a new instance if {@code ref} is
null.

@param ref   object to update, could be null
@param bytes bytes
@return same object as {@code ref} or a new instance if it's null
clickhouse-data/src/main/java/com/clickhouse/data/value/ClickHouseStringValue.java