Re: streaming json parser for j2me?
On 03/03/2011 05:40 AM, Joachim Lippold wrote:
Am 02.03.2011 15:10, schrieb Antti J??rvinen:
Is there json lib for microedition java that would let me de-serialize
the json format from a stream? This far I've only seen the org.json.me
lib that wants serialized content in as a String ; I'm kind of expecting
heap-size problems that InputStream might partly solve ; any other suggestions
besides keeping data chuncks small??
i [sic] recently wrote a small json [sic] parser for streams. It s not perfect and not
fully done (numbers are not parsed), but does all i [sic] need. Perhaps you can
build on this one:
http://bazaar.launchpad.net/~st-cdt/streamtastic/streamtastic-icecast/files/head:/src/l/joe/json/
Are the set of whitespace characters in JSON different from those recognized
by the 'Character' test? (Just curious. I'm not adept at JSON.)
It's not really a good idea to ignore IOException on 'close()', nor to catch
just 'Exception' in lower-level code.
You might want to use standard library code for methods like 'hexValue()'
rather than rolling your own. I think API calls would help 'readNumber()',
too, but I'm not certain.
It's good, clean code except I am a bit puzzled by the presence of private
instance methods but the absence of public instance methods. It's not bad, I
suppose, but I'm not used to that.
--
Lew
Honi soit qui mal y pense.