/** * Returns the content of the given {@code Appendable} as a string if possible, * or the localized <cite>"Unavailable content"</cite> string otherwise. */ static String toString(final Appendable out) { final CharSequence content = IO.content(out); if (content != null) { return content.toString(); } return Vocabulary.format(Vocabulary.Keys.UnavailableContent); }
/** * Returns the content of the given {@code Appendable} as a string if possible, * or the localized <cite>"Unavailable content"</cite> string otherwise. */ static String toString(final Appendable out) { final CharSequence content = IO.content(out); if (content != null) { return content.toString(); } return Vocabulary.format(Vocabulary.Keys.UnavailableContent); }
/** * Returns the content of the given writer, or {@code null} if none. */ static String content(final Writer out) { if (out instanceof StringWriter) { return out.toString(); } if (out instanceof FilterWriter) { return ((FilterWriter) out).content(); } final CharSequence cs = IO.content(out); if (cs != null) { return cs.toString(); } return null; }