JsonEvent readEvent() throws IOException {
        char next = readNext();
        // whitespace
        while (next == ' ' || next == '\t' || next == '\n' || next == '\r') {
            next = readNext();
        }
        // identify token
        switch (next) {
            case '{':
                return JsonEvent.OBJECT;
            case '}':
                return JsonEvent.OBJECT_END;
            case '[':
                return JsonEvent.ARRAY;
            case ']':
                return JsonEvent.ARRAY_END;
            case '"':
                return JsonEvent.STRING;
            case '-':
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                return acceptNumber(next);
            case 'n':
                return acceptNull();
            case 't':
                return acceptTrue();
            case 'f':
                return acceptFalse();
            case ',':
                return JsonEvent.COMMA;
            case ':':
                return JsonEvent.COLON;
            default:
                throw new IllegalArgumentException("Invalid JSON data: Expected JSON character but found '" + next + "'");
        }
    }
JsonEvent readEvent ( ) throws IOException { char next = readNext ( ) ; while ( next == ' ' || next == '\t' || next == '\n' || next == '\r' ) { next = readNext ( ) ; } switch ( next ) { case '{' : return JsonEvent . OBJECT ; case '}' : return JsonEvent . OBJECT_END ; case '[' : return JsonEvent . ARRAY ; case ']' : return JsonEvent . ARRAY_END ; case '"' : return JsonEvent . STRING ; case '-' : case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : return acceptNumber ( next ) ; case 'n' : return acceptNull ( ) ; case 't' : return acceptTrue ( ) ; case 'f' : return acceptFalse ( ) ; case ',' : return JsonEvent . COMMA ; case ':' : return JsonEvent . COLON ; default : throw new IllegalArgumentException ( "Invalid JSON data: Expected JSON character but found '" + next + "'" ) ; } }
Writes a JSON null.

@throws IOException if an error occurs