diggerydoo68 / json-simple

Automatically exported from code.google.com/p/json-simple
Apache License 2.0
0 stars 0 forks source link

Auutomatically stop parsing if JSON stanzais complete #66

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using json-simple to read JSON stanzas directly from a Reader which in turn 
comes from a TCP-Socket. While implementing this, I stumbled over a behavior in 
JSONParser. Parse.parse does not return if the stanza is complete, but wait for 
a EOF. I extended   public Object parse(Reader in, ContainerFactory 
containerFactory) throws IOException, ParseException by adding

                if(status==S_IN_FINISHED_VALUE) {
                    System.out.println("fertig?");
                    return valueStack.removeFirst();
                }

on line 259 (just before the closing while)

I'm using version 1.1, because I didn't find the sources for 1.1.1.

Original issue reported on code.google.com by mifritsc...@gmail.com on 28 Feb 2012 at 8:14

GoogleCodeExporter commented 8 years ago

Original comment by fangyid...@gmail.com on 28 Mar 2012 at 2:49