use of java.io.CharArrayWriter in project XobotOS by xamarin.
the class NetworkStatsHistory method toString.
@Override
public String toString() {
final CharArrayWriter writer = new CharArrayWriter();
dump("", new PrintWriter(writer), false);
return writer.toString();
}
use of java.io.CharArrayWriter in project android_frameworks_base by DirtyUnicorns.
the class NetworkStats method toString.
@Override
public String toString() {
final CharArrayWriter writer = new CharArrayWriter();
dump("", new PrintWriter(writer));
return writer.toString();
}
use of java.io.CharArrayWriter in project joda-time by JodaOrg.
the class TestPeriodFormatter method testPrint_writerMethods.
//-----------------------------------------------------------------------
public void testPrint_writerMethods() throws Exception {
Period p = new Period(1, 2, 3, 4, 5, 6, 7, 8);
CharArrayWriter out = new CharArrayWriter();
f.printTo(out, p);
assertEquals("P1Y2M3W4DT5H6M7.008S", out.toString());
out = new CharArrayWriter();
try {
f.printTo(out, null);
fail();
} catch (IllegalArgumentException ex) {
}
}
use of java.io.CharArrayWriter in project joda-time by JodaOrg.
the class TestDateTimeFormatter method testPrint_writerMethods.
//-----------------------------------------------------------------------
@SuppressWarnings("deprecation")
public void testPrint_writerMethods() throws Exception {
DateTime dt = new DateTime(2004, 6, 9, 10, 20, 30, 40, UTC);
CharArrayWriter out = new CharArrayWriter();
f.printTo(out, dt);
assertEquals("Wed 2004-06-09T10:20:30Z", out.toString());
out = new CharArrayWriter();
f.printTo(out, dt.getMillis());
assertEquals("Wed 2004-06-09T11:20:30+01:00", out.toString());
out = new CharArrayWriter();
ISODateTimeFormat.yearMonthDay().printTo(out, dt.toYearMonthDay());
assertEquals("2004-06-09", out.toString());
out = new CharArrayWriter();
try {
ISODateTimeFormat.yearMonthDay().printTo(out, (ReadablePartial) null);
fail();
} catch (IllegalArgumentException ex) {
}
}
use of java.io.CharArrayWriter in project android_frameworks_base by AOSPA.
the class NetworkStats method toString.
@Override
public String toString() {
final CharArrayWriter writer = new CharArrayWriter();
dump("", new PrintWriter(writer));
return writer.toString();
}
Aggregations