Well, now it sounds like you're reinventing mime types..., but this isn't a horrible way to do it either I suppose. In either case what's giving you the difficulty? You can send the bytestream by doing a standard read() and write() across the socket, so this shouldn't be too bad..
Kris On Fri, Dec 30, 2011 at 6:09 PM, SL <[email protected]> wrote: > I am thinking of adding another component, eg image, as follows: > > xxxaaaaThis is a greeting.iiibbbbmmmmmmmm... > > > where: > xxx - message type (3 bytes, text) > aaaa - integer, 4 bytes, length of text > 'This is a greeting.' - the actual text > iii - image type (png, gif) > bbbb - image length > mmmmmmmm... - image data > > I suppose your recommendation still stands, extract byte by byte. > > >> >> Use a byte buffer as Miguel suggested. Extract byte by byte (or long >> by long). >> You'll have to deal with the little endian / big endian problem >> regardless of the language/stack you chose. If you have the latitude, >> don't use binary... >> >> > > -- > Using Opera's revolutionary email client: http://www.opera.com/mail/ > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

