code: public void append(Encoder encoder, EncodingState encodingState, CharSequence str, int off, int len)
              throws IOException {
          if (str == null || len <= 0) {
              return;
          }
          if (shouldEncode(encoder, encodingState)) {
              EncodingState newEncoders = createNewEncodingState(encoder, encodingState);
              if (encoder instanceof StreamingEncoder) {
                  ((StreamingEncoder)encoder).encodeToStream(encoder, str, off, len, this, newEncoders);
              }
              else {
                  CharSequence source;
                  if (CharSequences.canUseOriginalForSubSequence(str, off, len)) {
                      source = str;
                  }
                  else {
                      source = str.subSequence(off, off + len);
                  }
                  encodeAndWrite(encoder, newEncoders, source);
              }
          }
          else {
              appendCharSequence(encodingState, str, off, off + len);
          }
      }
docs: /*
  (non-Javadoc)
  @see
  EncodedAppender#append(org
  .codehaus.groovy.grails.support.encoding.Encoder,
  EncodingState,
  java.lang.CharSequence, int, int)