Implement Closeable for JsonStreamFeeder
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
+import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;
@@ -28,7 +29,7 @@ import static java.util.Objects.requireNonNull;
/**
* @author jonmv
*/
-public class JsonStreamFeeder {
+public class JsonStreamFeeder implements Closeable {
private final FeedClient client;
private final OperationParameters protoParameters;
@@ -91,6 +92,8 @@ public class JsonStreamFeeder {
private static final JsonFactory factory = new JsonFactory();
+ @Override public void close() throws IOException { client.close(); }
+
private class RingBufferStream extends InputStream {
private final byte[] b = new byte[1];
