Permalink
Browse files

refactor: make PgStream implements Flushable (#1008)

  • Loading branch information...
AlexElin authored and vlsi committed Nov 11, 2017
1 parent 9f07c9a commit 0c3a2fc132101f83dbb0990ac2c49c49b9c65ffe
Showing with 3 additions and 1 deletion.
  1. +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();

0 comments on commit 0c3a2fc

Please sign in to comment.