On Tue, Oct 21, 2003 at 07:41:08PM +0200, Elizabeth Mattijsen wrote:
| If you ask me, you could do easy with a simple header line like:
| 
|   parrot xml 1.0
|   \0
| 
| basically magic word ('parrot')
|  followed by a space
|  followed by the type
|  followed by a space
|  followed by version
|  followed by a CRLF (not sure about this one, but could be nice)
|  followed by a null byte
| 
| I'm not clear if you would know beforehand how many bytes of data you 
| would receive.  If that is possible to know at all time, then I would 
| suggest having the length as an extra part of the header.

If you are going to go this far (including content-length) may I 
just suggest using a MIME envelope?  This has several advantages:

 - there are already readers for the format
 - it allows you to specify the 'Content-Type' as, say binary/parrot
   or text/yaml or text/xml
 - it gives you a place to put 'Content-Length'
 - it is extensible, allowing for other headers
 - it allows you to include other 'binary' blobs in the same file

Best,

Clark

Reply via email to