@Override
    public ClickHouseOutputStream transferBytes(byte[] bytes, int offset, int length) throws IOException {
        if (bytes == null) {
            throw new NullPointerException();
        } else if (offset < 0 || length < 0 || length > bytes.length - offset) {
            throw new IndexOutOfBoundsException();
        } else if (length == 0) {
            return this;
        }
        ensureOpen();

        if (position > 0) {
            flushBuffer();
        }
        flushBuffer(bytes, offset, length);
        return this;
    }
Writes the given byte array without using {@code buffer} and
{@code position}.

@param bytes  non-null byte array to write
@param offset offset
@param length length in byte
@throws IOException when failed to write data
clickhouse-data/src/main/java/com/clickhouse/data/stream/AbstractByteArrayOutputStream.java