public ClickHouseByteBuffer copy(boolean deep) {
        byte[] bytes;
        int pos;
        if (deep) {
            bytes = new byte[length];
            pos = 0;
            System.arraycopy(array, position, bytes, 0, length);
        } else {
            bytes = array;
            pos = position;
        }
        return ClickHouseByteBuffer.of(bytes, pos, length);
    }
Creates a copy of the current byte buffer.

@param deep true to copy the underlying byte array; false to reuse
@return non-null copy of the current byte buffer
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseByteBuffer.java