public class CopyDualImpl extends CopyOperationImpl implements CopyDual
Constructor and Description |
---|
CopyDualImpl() |
Modifier and Type | Method and Description |
---|---|
long |
endCopy()
Finishes copy operation successfully.
|
void |
flushCopy()
Force any buffered output to be sent over the network to the backend.
|
void |
handleCommandStatus(String status) |
protected void |
handleCopydata(byte[] data)
Consume received copy data.
|
byte[] |
readFromCopy()
Blocks wait for a row of data to be received from server on an active copy operation.
|
byte[] |
readFromCopy(boolean block)
Wait for a row of data to be received from server on an active copy operation.
|
void |
writeToCopy(byte[] data,
int off,
int siz)
Writes specified part of given byte array to an open and writable copy operation.
|
void |
writeToCopy(ByteStreamWriter from)
Writes a ByteStreamWriter to an open and writable copy operation.
|
cancelCopy, getFieldCount, getFieldFormat, getFormat, getHandledRowCount, getQueryExecutor, isActive
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancelCopy, getFieldCount, getFieldFormat, getFormat, getHandledRowCount, isActive
public void writeToCopy(byte[] data, int off, int siz) throws SQLException
CopyIn
writeToCopy
in interface CopyIn
data
- array of bytes to writeoff
- offset of first byte to write (normally zero)siz
- number of bytes to write (normally buf.length)SQLException
- if the operation failspublic void writeToCopy(ByteStreamWriter from) throws SQLException
CopyIn
writeToCopy
in interface CopyIn
from
- the source of bytes, e.g. a ByteBufferByteStreamWriterSQLException
- if the operation failspublic void flushCopy() throws SQLException
CopyIn
flushCopy
in interface CopyIn
SQLException
- if the operation fails.public long endCopy() throws SQLException
CopyIn
endCopy
in interface CopyIn
SQLException
- if the operation fails.public byte[] readFromCopy() throws SQLException
CopyOut
readFromCopy
in interface CopyOut
SQLException
- if something goes wrong for example socket timeoutpublic byte[] readFromCopy(boolean block) throws SQLException
CopyOut
readFromCopy
in interface CopyOut
block
- true
if need wait data from server otherwise false
and will read
pending message from serverSQLException
- if something goes wrong for example socket timeoutpublic void handleCommandStatus(String status) throws PSQLException
handleCommandStatus
in class CopyOperationImpl
PSQLException
protected void handleCopydata(byte[] data)
CopyOperationImpl
handleCopydata
in class CopyOperationImpl
data
- data that was receive by copy protocolCopyright © 1997-2020 PostgreSQL Global Development Group. All Rights Reserved.