code: public void sendData() throws IOException {
          if (writer != null) {
              writer.write(buffer.toString());
              writer.flush();
              buffer = new StringBuilder();
          }
      }
docs: Send data and reinitializes buffer.
  
  @throws IOException