code: private static void writeCharSequence(CharSequence seq, CharBuf buffer) {
          if (seq.length() > 0) {
              buffer.addJsonEscapedString(seq.toString());
          } else {
              buffer.addChars(EMPTY_STRING_CHARS);
          }
      }
docs: Serializes any char sequence and writes it into specified buffer.