@Override
 public void flush() throws IOException {
   super.flush();
   setCommitted(true);
 }
 @Override
 public void write(int b) throws IOException {
   super.write(b);
   super.flush();
   setCommittedIfBufferSizeExceeded();
 }