use of java.io.CharArrayWriter in project android_frameworks_base by AOSPA.
the class VolumeInfo method toString.
@Override
public String toString() {
final CharArrayWriter writer = new CharArrayWriter();
dump(new IndentingPrintWriter(writer, " ", 80));
return writer.toString();
}
use of java.io.CharArrayWriter in project android_frameworks_base by AOSPA.
the class StorageVolume method dump.
/** {@hide} */
// TODO(b/26742218): find out where toString() is called internally and replace these calls by
// dump().
public String dump() {
final CharArrayWriter writer = new CharArrayWriter();
dump(new IndentingPrintWriter(writer, " ", 80));
return writer.toString();
}
use of java.io.CharArrayWriter in project android_frameworks_base by AOSPA.
the class DiskInfo method toString.
@Override
public String toString() {
final CharArrayWriter writer = new CharArrayWriter();
dump(new IndentingPrintWriter(writer, " ", 80));
return writer.toString();
}
use of java.io.CharArrayWriter in project android_frameworks_base by AOSPA.
the class NetworkStatsHistory method toString.
@Override
public String toString() {
final CharArrayWriter writer = new CharArrayWriter();
dump(new IndentingPrintWriter(writer, " "), false);
return writer.toString();
}
use of java.io.CharArrayWriter in project jdk8u_jdk by JetBrains.
the class bug8005391 method main.
public static void main(String[] args) throws Exception {
int N = 10;
for (int i = 0; i < N; i++) {
HTMLEditorKit kit = new HTMLEditorKit();
Class c = Class.forName("javax.swing.text.html.parser.ParserDelegator");
HTMLEditorKit.Parser parser = (HTMLEditorKit.Parser) c.newInstance();
HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument();
HTMLEditorKit.ParserCallback htmlReader = doc.getReader(0);
parser.parse(new CharArrayReader(htmlDoc.toCharArray()), htmlReader, true);
htmlReader.flush();
CharArrayWriter writer = new CharArrayWriter(1000);
kit.write(writer, doc, 0, doc.getLength());
writer.flush();
String result = writer.toString();
if (!result.contains("<tt><a")) {
throw new RuntimeException("The <a> and <tt> tags are swapped");
}
}
}
Aggregations