code: public final void write(final char[] buffer, final int offset,
                              final int length) throws IOException {
          final int maxIndex = offset + length - 1;
          for (int i = offset; i <= maxIndex; i++) {
  
              // debugging..
              if (log.isTraceEnabled()) {
                  log.trace("char [" + buffer[i] + "], line length ["
                          + lineLength + "]");
              }
  
              // check for fold first so we don't unnecessarily fold after
              // no more data..
              if (lineLength >= foldLength) {
                  super.write(FOLD_PATTERN, 0, FOLD_PATTERN.length);
  
                  // re-initialise to 1 to account for the space in fold pattern..
                  lineLength = 1;
              }
  
              super.write(buffer[i]);
  
              if (buffer[i] == '\r' || buffer[i] == '\n') {
                  lineLength = 0;
              } else {
                  lineLength += 1;
              }
          }
      }
docs: {@inheritDoc}