writeToCopy

fun writeToCopy(data: ByteArray, offset: Int = 0, length: Int = data.size)

Writes a chunk of data to the server.

Each call is one protocol message and one flush, so chunks want to be substantial rather than row-sized. Nothing is validated against the target table here; the server checks the data when it parses it, and a malformed chunk surfaces from endCopy rather than from this call.

Parameters

data

The bytes to send.

offset

Where to start in data.

length

How many bytes to send.

Throws

RESOURCE_CLOSED if the operation has already finished.