code: public int read(final char[] cbuf, final int off, final int len) throws IOException {
          final int read = super.read(cbuf, off, len);
          boolean doUnfold = false;
          for (char[] pattern : patterns) {
              if (read > 0 && cbuf[0] == pattern[0]) {
                  doUnfold = true;
                  break;
              } else {
                  for (int j = 0; j < read; j++) {
                      if (cbuf[j] == pattern[0]) {
                          unread(cbuf, j, read - j);
                          return j;
                      }
                  }
              }
          }
          if (!doUnfold) {
              return read;
          } else {
              unread(cbuf, off, read);
          }
  
          unfold();
  
          return super.read(cbuf, off, maxPatternLength);
      }
docs: {@inheritDoc}