Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
refactor: make PgStream implements Flushable (#1008)
- Loading branch information
Showing
with
3 additions
and
1 deletion.
-
+3
−1
pgjdbc/src/main/java/org/postgresql/core/PGStream.java
|
@@ -14,6 +14,7 @@ |
|
|
import java.io.Closeable; |
|
|
import java.io.EOFException; |
|
|
import java.io.FilterOutputStream; |
|
|
import java.io.Flushable; |
|
|
import java.io.IOException; |
|
|
import java.io.InputStream; |
|
|
import java.io.OutputStream; |
|
@@ -30,7 +31,7 @@ |
|
|
* In general, instances of PGStream are not threadsafe; the caller must ensure that only one thread |
|
|
* at a time is accessing a particular PGStream instance. |
|
|
*/ |
|
|
public class PGStream implements Closeable { |
|
|
public class PGStream implements Closeable, Flushable { |
|
|
private final SocketFactory socketFactory; |
|
|
private final HostSpec hostSpec; |
|
|
|
|
@@ -502,6 +503,7 @@ public void sendStream(InputStream inStream, int remaining) throws IOException { |
|
|
* |
|
|
* @throws IOException if an I/O error occurs |
|
|
*/ |
|
|
@Override |
|
|
public void flush() throws IOException { |
|
|
if (encodingWriter != null) { |
|
|
encodingWriter.flush(); |
|
|