| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final byte[] | |
| private @Nullable CopyIn | |
| private final byte[] |
| Access | Constructor and Description |
|---|---|
| public | PGCopyOutputStream(PGConnection
database connection to use for copying (protocol version 3 required) connection, String COPY FROM STDIN statement sql)Uses given connection for specified COPY FROM STDIN operation. |
| public | PGCopyOutputStream(PGConnection
database connection to use for copying (protocol version 3 required) connection, String COPY FROM STDIN statement sql, int try to send this many bytes at a time bufferSize)Uses given connection for specified COPY FROM STDIN operation. |
| public | |
| public | PGCopyOutputStream(CopyIn
COPY FROM STDIN operation op, int try to send this many bytes at a time bufferSize)Use given CopyIn operation for writing. |
| Modifier and Type | Method and Description |
|---|---|
| public void | cancelCopy()
Implements org. Cancels this copy operation, discarding any exchanged data. |
| private void | |
| public void | close()
Overrides java. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| public long | |
| public void | flush()
Overrides java. Implements java. Flushes this output stream and forces any buffered output bytes to be written out. |
| public void | flushCopy()
Implements org. Force any buffered output to be sent over the network to the backend. |
| public int | |
| public int | getFieldFormat(int
number of field (0..fieldCount()-1) field)Implements org.
|
| public int | |
| public long | getHandledRowCount()
Implements org. After successful end of copy, returns the number of database records handled in that operation. |
| private CopyIn | |
| public boolean | |
| public void | write(int
the b)byte.Implements abstract java. Writes the specified byte to this output stream. |
| public void | write(byte[]
the data. buf)Overrides java. Writes |
| public void | write(byte[]
the data. buf, int the start offset in the data. off, int the number of bytes to write. siz)Overrides java. Writes |
| public void | writeToCopy(byte[]
array of bytes to write buf, int offset of first byte to write (normally zero) off, int number of bytes to write (normally buf.length) siz)Implements org. Writes specified part of given byte array to an open and writable copy operation. |
| public void | writeToCopy(ByteStreamWriter
the source of bytes, e.g. a ByteBufferByteStreamWriter from)Implements org. Writes a ByteStreamWriter to an open and writable copy operation. |
| at | back to summary |
|---|---|
| private int at | |
| copyBuffer | back to summary |
|---|---|
| private final byte[] copyBuffer | |
| op | back to summary |
|---|---|
| private @Nullable CopyIn op | |
| singleByteBuffer | back to summary |
|---|---|
| private final byte[] singleByteBuffer | |
| PGCopyOutputStream | back to summary |
|---|---|
| public PGCopyOutputStream(PGConnection connection, String sql) throws SQLException Uses given connection for specified COPY FROM STDIN operation.
| |
| PGCopyOutputStream | back to summary |
|---|---|
| public PGCopyOutputStream(PGConnection connection, String sql, int bufferSize) throws SQLException Uses given connection for specified COPY FROM STDIN operation.
| |
| PGCopyOutputStream | back to summary |
|---|---|
| public PGCopyOutputStream(CopyIn op) Use given CopyIn operation for writing.
| |
| PGCopyOutputStream | back to summary |
|---|---|
| public PGCopyOutputStream(CopyIn op, int bufferSize) Use given CopyIn operation for writing.
| |
| cancelCopy | back to summary |
|---|---|
| public void cancelCopy() throws SQLException Implements org. Doc from org. Cancels this copy operation, discarding any exchanged data.
| |
| checkClosed | back to summary |
|---|---|
| private void checkClosed() throws IOException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| endCopy | back to summary |
|---|---|
| public long endCopy() throws SQLException Implements org. Doc from org. Finishes copy operation successfully.
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Doc from java. Flushes this output stream and forces any buffered output bytes
to be written out. The general contract of If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| flushCopy | back to summary |
|---|---|
| public void flushCopy() throws SQLException Implements org. Doc from org. Force any buffered output to be sent over the network to the backend. In general this is a useless operation as it will get pushed over in due time or when endCopy is called. Some specific modified server versions (Truviso) want this data sooner. If you are unsure if you need to use this method, don't.
| |
| getFieldCount | back to summary |
|---|---|
| public int getFieldCount() Implements org.
| |
| getFieldFormat | back to summary |
|---|---|
| public int getFieldFormat(int field) Implements org.
| |
| getFormat | back to summary |
|---|---|
| public int getFormat() Implements org.
| |
| getHandledRowCount | back to summary |
|---|---|
| public long getHandledRowCount() Implements org. Doc from org. After successful end of copy, returns the number of database records handled in that operation. Only implemented in PostgreSQL server version 8.2 and up. Otherwise, returns -1.
| |
| getOp | back to summary |
|---|---|
| private CopyIn getOp() | |
| isActive | back to summary |
|---|---|
| public boolean isActive() Implements org.
| |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(byte[] buf) throws IOException Overrides java. Doc from java. Writes
| |
| write | back to summary |
|---|---|
| public void write(byte[] buf, int off, int siz) throws IOException Overrides java. Doc from java. Writes
If
If
| |
| writeToCopy | back to summary |
|---|---|
| public void writeToCopy(byte[] buf, int off, int siz) throws SQLException Implements org. Doc from org. Writes specified part of given byte array to an open and writable copy operation.
| |
| writeToCopy | back to summary |
|---|---|
| public void writeToCopy(ByteStreamWriter from) throws SQLException Implements org. Doc from org. Writes a ByteStreamWriter to an open and writable copy operation.
| |