stream of data from server to client, what is a good form
I am building a small client server app where the server is constantly sending data to the client. The data is such that it readily lends itself to being in key/value pairs. My thought is to basically have the server send out a string of text to the client like "1:name, 2:age, 3:date, 4:salary" and then have the client parse it out. I can have an object, and just make a toString() method that spits out the fields in that way. But...
Do you guys think this is a good way of sending data out. I will only have at most 20 clients running at once, and the data will get no more than say, 50 key/value pairs. Another way I suppose is to convert it to XML, I'd have to read more about it because I'm not exactly sure how to encapsulate data into XML format or how to use Java's DOM API, but perhaps that is overkill, what do you guys think. Also is there an existing Java parsing API out there already, somethign that I haven't found, that would make all of this very easy? As of right now I have to make sure my output stream is in good form, and then still the client will have to do some kludging parsing with commas and what not. Any suggestions would be appreciated.

