code: private void checkLine() {
      String endStr = new String(buf, count - LINE_SEPERATOR.length(), LINE_SEPERATOR.length(), charset);
      if (LINE_SEPERATOR.equals(endStr)) {
        flush();
      }
    }
docs: Checks if the end of the buffer contains a newline and if so, flushes the stream