// and then sequence of other things
JsonParser jp = createParserUsingReader("[ 32, [ 1 ], \"abc\", { \"a\" : true } ]");
assertToken(JsonToken.START_ARRAY, jp.nextToken());
assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken());
TokenBuffer buf = m.readValue(jp, TokenBuffer.class);
// check manually...
JsonParser bufParser = buf.asParser();
assertToken(JsonToken.VALUE_NUMBER_INT, bufParser.nextToken());
assertEquals(32, bufParser.getIntValue());
assertNull(bufParser.nextToken());
// then bind to another
buf = m.readValue(jp, TokenBuffer.class);
bufParser = buf.asParser();
assertToken(JsonToken.START_ARRAY, bufParser.nextToken());
assertToken(JsonToken.VALUE_NUMBER_INT, bufParser.nextToken());
assertEquals(1, bufParser.getIntValue());
assertToken(JsonToken.END_ARRAY, bufParser.nextToken());
assertNull(bufParser.nextToken());
// third one, with automatic binding
buf = m.readValue(jp, TokenBuffer.class);
String str = m.readValue(buf.asParser(), String.class);
assertEquals("abc", str);
// and ditto for last one
buf = m.readValue(jp, TokenBuffer.class);
Map<?,?> map = m.readValue(buf.asParser(), Map.class);
assertEquals(1, map.size());
assertEquals(Boolean.TRUE, map.get("a"));
assertEquals(JsonToken.END_ARRAY, jp.nextToken());
assertNull(jp.nextToken());