Package com.alibaba.fastjson.serializer

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


    public void test_erro_0() throws Exception {
        SerializeWriter out = new SerializeWriter();
        out.write(true);
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        out.writeTo(byteOut, "UTF-8");
        Assert.assertEquals("true", new String(byteOut.toByteArray()));
        out.close();
    }

}
View Full Code Here


    public void writeObject(Object obj) throws IOException {
        SerializeWriter out = new SerializeWriter();
        JSONSerializer serializer = new JSONSerializer(out);
        serializer.config(SerializerFeature.WriteEnumUsingToString, true);
        serializer.write(obj);
        out.writeTo(writer);
        writer.println();
        writer.flush();
    }

    public void flushBuffer() throws IOException {
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.