private static Object readDynamic ( StreamingInput input ) throws IOException { switch ( input . peek ( ) ) { case VALUE : input . next ( ) ; return input . getValue ( ) ; case NULL : input . next ( ) ; return input . getValue ( ) ; case LIST_START : return readList ( input ) ; case OBJECT_START : return readMap ( input ) ; } throw new SerializationException ( "Unable to read file, unknown start of value: " + input . peek ( ) ) ; }
Depending on the next token read either a value a list or a map .