code: protected void encodeAndWrite(Encoder encoder, EncodingState newEncodingState, CharSequence input)
              throws IOException {
          Object encoded = encoder.encode(input);
          if (encoded != null) {
              String encodedStr = String.valueOf(encoded);
              write(newEncodingState, encodedStr, 0, encodedStr.length());
          }
      }
docs: Encode and write input to buffer using a non-streaming encoder
  
  @param encoder
  the encoder to use
  @param newEncodingState
  the new encoding state after encoder has been applied
  @param input
  the input CharSequence
  @throws IOException
  Signals that an I/O exception has occurred.