Skip to content

Commit

Permalink
refactor: make PgStream implements Flushable (#1008)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexElin authored and vlsi committed Nov 11, 2017
1 parent 9f07c9a commit 0c3a2fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pgjdbc/src/main/java/org/postgresql/core/PGStream.java
Expand Up @@ -14,6 +14,7 @@
import java.io.Closeable; import java.io.Closeable;
import java.io.EOFException; import java.io.EOFException;
import java.io.FilterOutputStream; import java.io.FilterOutputStream;
import java.io.Flushable;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
Expand All @@ -30,7 +31,7 @@
* In general, instances of PGStream are not threadsafe; the caller must ensure that only one thread * 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. * 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 SocketFactory socketFactory;
private final HostSpec hostSpec; private final HostSpec hostSpec;


Expand Down Expand Up @@ -502,6 +503,7 @@ public void sendStream(InputStream inStream, int remaining) throws IOException {
* *
* @throws IOException if an I/O error occurs * @throws IOException if an I/O error occurs
*/ */
@Override
public void flush() throws IOException { public void flush() throws IOException {
if (encodingWriter != null) { if (encodingWriter != null) {
encodingWriter.flush(); encodingWriter.flush();
Expand Down

0 comments on commit 0c3a2fc

Please sign in to comment.