I want to send an audio file (converted to a byte array) and text data in one http output stream from a J2ME cell phone client that is MIDP 1.0.
What is the easiest way to do this and still be able to differentiate the audio byte array from the text data on the servlet side?
I have done alot of googling on this and don't seem to find a straightforward solution:
-MIME content type "multipart/mixed" seems plausible, but I only see it used in email clients, and I'm not sending an email message
- I see Michael Yuan says you can send an image file as a byte array over http using DataOutputStream, but how would you send text data, too? Should you set up your own token system? Perhaps you could insert the byte array length into the DataOutputStream, read it on the servlet side starting at the offset for length number of bytes? And then assume everything after that is string data?
...or is there another way? I assume this is the same as sending an image as a byte array...