@Test public void flushesAfterWrite() throws IOException { ObjectWriter objectWriter = new AutoFlushingObjectWriter(objectOutputStream, 2); String object = "foo"; objectWriter.write(object); InOrder inOrder = inOrder(objectOutputStream); inOrder.verify(objectOutputStream).writeObjectOverride(object); inOrder.verify(objectOutputStream).flush(); }
@Override public void write(Object object) throws IOException { objectOutputStream.writeObject(object); objectOutputStream.flush(); preventMemoryLeak(); }
AutoFlushingObjectWriter implements ObjectWriter { @Override public void write(Object object) throws IOException { objectOutputStream.writeObject(object); objectOutputStream.flush(); preventMemoryLeak(); } }
AutoFlushingObjectWriter implements ObjectWriter { @Override public void write(Object object) throws IOException { objectOutputStream.writeObject(object); objectOutputStream.flush(); preventMemoryLeak(); } AutoFlushingObjectWriter(ObjectOutputStream objectOutputStream, int resetFrequency); }
AutoFlushingObjectWriter implements ObjectWriter { @Override public void write(Object object) throws IOException { objectOutputStream.writeObject(object); objectOutputStream.flush(); preventMemoryLeak(); } AutoFlushingObjectWriter(ObjectOutputStream objectOutputStream, int resetFrequency); @Override void write(Object object); }
AutoFlushingObjectWriter implements ObjectWriter { @Override public void write(Object object) throws IOException { objectOutputStream.writeObject(object); objectOutputStream.flush(); preventMemoryLeak(); } AutoFlushingObjectWriter(ObjectOutputStream objectOutputStream, int resetFrequency); @Override void write(Object object);  }