Search in sources :

Example 86 with CharArrayWriter

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();
}
Also used : CharArrayWriter(java.io.CharArrayWriter) PrintWriter(java.io.PrintWriter)

Example 87 with CharArrayWriter

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();
}
Also used : CharArrayWriter(java.io.CharArrayWriter) PrintWriter(java.io.PrintWriter)

Example 88 with CharArrayWriter

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) {
    }
}
Also used : Period(org.joda.time.Period) MutablePeriod(org.joda.time.MutablePeriod) CharArrayWriter(java.io.CharArrayWriter)

Example 89 with CharArrayWriter

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) {
    }
}
Also used : DateTime(org.joda.time.DateTime) LocalDateTime(org.joda.time.LocalDateTime) MutableDateTime(org.joda.time.MutableDateTime) CharArrayWriter(java.io.CharArrayWriter)

Example 90 with CharArrayWriter

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();
}
Also used : CharArrayWriter(java.io.CharArrayWriter) PrintWriter(java.io.PrintWriter)

Aggregations

CharArrayWriter (java.io.CharArrayWriter)116 PrintWriter (java.io.PrintWriter)28 IndentingPrintWriter (com.android.internal.util.IndentingPrintWriter)21 IOException (java.io.IOException)16 BufferedReader (java.io.BufferedReader)7 ArrayList (java.util.ArrayList)7 CharArrayReader (java.io.CharArrayReader)6 Test (org.junit.Test)5 File (java.io.File)4 Reader (java.io.Reader)4 StringReader (java.io.StringReader)4 HashMap (java.util.HashMap)4 FeatureVector (com.airbnb.aerosolve.core.FeatureVector)3 ModelHeader (com.airbnb.aerosolve.core.ModelHeader)3 ModelRecord (com.airbnb.aerosolve.core.ModelRecord)3 BufferedWriter (java.io.BufferedWriter)3 InputStreamReader (java.io.InputStreamReader)3 StreamResult (javax.xml.transform.stream.StreamResult)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 InputStream (java.io.InputStream)2