RedisStreamWriter implements Closeable { public void flush() throws IOException { flushBuffer(); outputStream.flush(); } RedisStreamWriter(OutputStream outputStream); void flush(); void write(byte theByte); void write(int value); void writeNewLine(); void write(byte[] bytes); void write(final byte[] bytes, final int offset, final int length); @Override void close(); static final int BUFFER_SIZE; }
@Test public void flush() throws IOException { writer.flush(); verify(outputStream).flush(); verify(outputStream).write(writer.buffer, 0, writer.position); assertEquals(writer.position, 0); }