The default serializer for messages. This serializer has two goals: 1) generate pseudo-HTTP 1.1 requests and responses (as defined in RFC-2616) and 2) make it convenient to work with the resulting messages using standard unix tools. When #1 and #2 are in conflict, favor #2.
Ultimately, TestDefaultMessageSerializer, in the test module, defines the behavior for this class. If a particular case is not handled in TestDefaultMessageSerializer it is safe to assume the behavior is undefined. The following paragraphs describe some of the behavior of this class.
Messages written out are nearly RFC-2616 conformant, with the following specifics:
- RFC-2616 field-values can be split across multiple lines. We use a transform described in RFC-2616 to collapse multiple lines into a single line.
- We do no special handling for invalid character sequences in field-values.
- We insert a CRLF at the end of the entity to make it easier to use with unix tools and editors.
Messages read in have the following specifics:
- end-of-line is looser than the RFC-2616 spec: we only look for LF and we ignore all CR's.
- Leading and trailing whitespace in a field-value are stripped, which is allowed for in RFC-2616.
- A trailing LF or CRLF at the end of an entity will be stripped (see above where we add an extract CRLF).
@author Chris Pettitt
@version $Revision$