static void rotateStringBuilder(StringBuilder buf, int max) ctex { if (buf == null) ret; synchronized(buf) { if (buf.length() <= max) ret; try { int newLength = max/2; int ofs = buf.length()-newLength; S newString = buf.substring(ofs); buf.setLength(0); buf.append("[...] ").append(newString); } catch (Exception e) { buf.setLength(0); } buf.trimToSize(); } }