Package com.alibaba.fastjson.serializer

Examples of com.alibaba.fastjson.serializer.SerializeWriter.toCharArray()


    public void test_12() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
        out.append("abc");
        Assert.assertEquals("abc", out.toString());
        Assert.assertEquals(3, out.toCharArray().length);
        Assert.assertEquals(3, out.size());
        out.reset();
        Assert.assertEquals("", out.toString());
        Assert.assertEquals(0, out.toCharArray().length);
        Assert.assertEquals(0, out.size());
View Full Code Here


        Assert.assertEquals("abc", out.toString());
        Assert.assertEquals(3, out.toCharArray().length);
        Assert.assertEquals(3, out.size());
        out.reset();
        Assert.assertEquals("", out.toString());
        Assert.assertEquals(0, out.toCharArray().length);
        Assert.assertEquals(0, out.size());
        out.writeInt(Integer.MIN_VALUE);
        Assert.assertEquals(Integer.toString(Integer.MIN_VALUE), out.toString());
        out.flush();
        out.close();
View Full Code Here

   
    public void test_error_4() throws Exception {
        SerializeWriter writer = new SerializeWriter(new StringWriter());
        Exception error = null;
        try {
            writer.toCharArray();
        } catch (Exception ex) {
            error = ex;
        }
        Assert.assertNotNull(error);
        writer.close();
View Full Code Here

    public void test_12() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
        out.append("abc");
        Assert.assertEquals("abc", out.toString());
        Assert.assertEquals(3, out.toCharArray().length);
        Assert.assertEquals(3, out.size());
        out.reset();
        Assert.assertEquals("", out.toString());
        Assert.assertEquals(0, out.toCharArray().length);
        Assert.assertEquals(0, out.size());
View Full Code Here

        Assert.assertEquals("abc", out.toString());
        Assert.assertEquals(3, out.toCharArray().length);
        Assert.assertEquals(3, out.size());
        out.reset();
        Assert.assertEquals("", out.toString());
        Assert.assertEquals(0, out.toCharArray().length);
        Assert.assertEquals(0, out.size());
        out.writeInt(Integer.MIN_VALUE);
        Assert.assertEquals(Integer.toString(Integer.MIN_VALUE), out.toString());
        out.flush();
        out.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.