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");
}
}
}
use of java.io.CharArrayWriter in project jdk8u_jdk by JetBrains.
the class InjectBytecodes method traceFixedWidthInt.
/**
* Print an integer so that it takes 'length' characters in
* the output. Temporary until formatting code is stable.
*/
private void traceFixedWidthInt(int x, int length) {
if (Inject.verbose) {
CharArrayWriter baStream = new CharArrayWriter();
PrintWriter pStream = new PrintWriter(baStream);
pStream.print(x);
String str = baStream.toString();
for (int cnt = length - str.length(); cnt > 0; --cnt) trace(" ");
trace(str);
}
}
use of java.io.CharArrayWriter in project android_frameworks_base by DirtyUnicorns.
the class NetworkStatsHistory method toString.
@Override
public String toString() {
final CharArrayWriter writer = new CharArrayWriter();
dump(new IndentingPrintWriter(writer, " "), false);
return writer.toString();
}
Aggregations