Package org.codehaus.jackson.util

Examples of org.codehaus.jackson.util.TokenBuffer.writeObject()


    public void testBinaryData() throws Exception
    {
        ObjectMapper mapper = new ObjectMapper();
        TokenBuffer buf = new TokenBuffer(mapper);
        buf.writeObject(new byte[3]);
        JsonNode node = mapper.readTree(buf.asParser());
//        assertTrue(node.isBinary());
        byte[] data = node.getBinaryValue();
        assertNotNull(data);
        assertEquals(3, data.length);
View Full Code Here


    public void testEmbeddedObjectInArray() throws Exception
    {
        ObjectMapper mapper = new ObjectMapper();
        TokenBuffer buf = new TokenBuffer(mapper);
        buf.writeStartArray();
        buf.writeObject(MARKER);
        buf.writeEndArray();
        JsonNode node = mapper.readTree(buf.asParser());
        assertTrue(node.isArray());
        assertEquals(1, node.size());
        JsonNode n = node.get(0);
View Full Code Here

    {
        ObjectMapper mapper = new ObjectMapper();
        TokenBuffer buf = new TokenBuffer(mapper);
        buf.writeStartObject();
        buf.writeFieldName("pojo");
        buf.writeObject(MARKER);
        buf.writeEndObject();
        JsonNode node = mapper.readTree(buf.asParser());
        assertTrue(node.isObject());
        assertEquals(1, node.size());
        JsonNode n = node.get("pojo");
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.