Some sun.misc internal APIs are deprectaed in JDK 9 and will be encapsulated or removed in a future release.
public String toJavaFormatString() { char result[] = (char[])(perThreadBuffer.get()); int i = getChars(result); return new String(result, 0, i); }
public void appendTo(Appendable buf) { char result[] = (char[])(perThreadBuffer.get()); int i = getChars(result); if (buf instanceof StringBuilder) ((StringBuilder) buf).append(result, 0, i); else if (buf instanceof StringBuffer) ((StringBuffer) buf).append(result, 0, i); else assert false; }