Assuming it's Jython (or Python in general) on both ends, you can use cPickle. Otherwise you might choose PyAMF (good also for Flex clients) or JSON (rather universal coverage at this point).

On Sat, Jul 11, 2009 at 12:24 PM, Carl <s7plc@ttlc.net> wrote:

I’ve written a Jython socket program that grabs incoming messages and writes them to a database. It works great with my test data.

 

But now, I want to send a message that contains mixed data types. During testing, I had the luxury of encoding and decoding on both ends, but in this case I can’t do that. For instance, I might have this list of data:

 

[‘Test’1,’Test2,100,7,18,’21’]

 

What I want to do is concatenate each item in the list into a string for the socket.send. Note that this needs to be a raw stream of bytes, so converting 100 to a string isn’t possible. Obviously I can’t just use a ‘’.join due to the non-string variables, so I looked at the java libraries and it looks like some combination of jarray, java.lang.string, and outputstream should work. Can someone point me in the right direction?

 

Thanks.

 

Carl


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users




--
Jim Baker
jbaker@zyasoft.com