Search in sources :

Example 1 with UTF8StreamJsonParser

use of com.fasterxml.jackson.core.json.UTF8StreamJsonParser in project jackson-core by FasterXML.

the class JsonParserSequenceTest method testSkipChildren.

@Test
public void testSkipChildren() throws IOException {
    JsonParser[] jsonParserArray = new JsonParser[3];
    IOContext ioContext = new IOContext(new BufferRecycler(), jsonParserArray, true);
    byte[] byteArray = new byte[8];
    InputStream byteArrayInputStream = new ByteArrayInputStream(byteArray, 0, (byte) 58);
    UTF8StreamJsonParser uTF8StreamJsonParser = new UTF8StreamJsonParser(ObjectReadContext.empty(), ioContext, 0, byteArrayInputStream, ByteQuadsCanonicalizer.createRoot(), byteArray, -1, (byte) 9, true);
    JsonParserDelegate jsonParserDelegate = new JsonParserDelegate(jsonParserArray[0]);
    JsonParserSequence jsonParserSequence = JsonParserSequence.createFlattened(true, uTF8StreamJsonParser, jsonParserDelegate);
    JsonParserSequence jsonParserSequenceTwo = (JsonParserSequence) jsonParserSequence.skipChildren();
    assertEquals(2, jsonParserSequenceTwo.containedParsersCount());
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) IOContext(com.fasterxml.jackson.core.io.IOContext) UTF8StreamJsonParser(com.fasterxml.jackson.core.json.UTF8StreamJsonParser) ReaderBasedJsonParser(com.fasterxml.jackson.core.json.ReaderBasedJsonParser) JsonParser(com.fasterxml.jackson.core.JsonParser) UTF8StreamJsonParser(com.fasterxml.jackson.core.json.UTF8StreamJsonParser) BaseTest(com.fasterxml.jackson.core.BaseTest) Test(org.junit.Test)

Aggregations

BaseTest (com.fasterxml.jackson.core.BaseTest)1 JsonParser (com.fasterxml.jackson.core.JsonParser)1 IOContext (com.fasterxml.jackson.core.io.IOContext)1 ReaderBasedJsonParser (com.fasterxml.jackson.core.json.ReaderBasedJsonParser)1 UTF8StreamJsonParser (com.fasterxml.jackson.core.json.UTF8StreamJsonParser)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 Test (org.junit.Test)1