Here you can find the source of appendTo(StringBuffer sb, CharSequence s)
static StringBuffer appendTo(StringBuffer sb, CharSequence s)
//package com.java2s; // License as published by the Free Software Foundation; either import java.io.IOException; import java.io.Writer; public class Main { static StringBuffer appendTo(StringBuffer sb, CharSequence s) { return appendTo(sb, s, 0, s.length()); }/*from w ww . j a v a 2 s . com*/ static StringBuffer appendTo(StringBuffer sb, CharSequence s, int start, int end) { while (start < end) { sb.append(s.charAt(start)); start++; } return sb; } static Writer appendTo(Writer writer, CharSequence s) throws IOException { return appendTo(writer, s, 0, s.length()); } static Writer appendTo(Writer writer, CharSequence s, int start, int end) throws IOException { while (start < end) { writer.write(s.charAt(start)); start++; } return writer; } }