2009-05-21 19:00:46 UTC
Hehe. Good luck! If you get it to work, let us know!
The worst part for me is the additional interface complexity required for classes that want to receive an HTTP Request and return and HTTP Response:
void processRequestHeader(byte[] header);
void processRequestContent(byte[] content);
void noMoreRequestContent();
I guess it would be simple enough to pass an empty or null byte[] content when the message content is finished, rather than requiring the noMoreRequestContent() method. Effectively the same as ending chunked transfer with a zero-byte chunk :-)
My current Message interface has 2 fields:
byte[] header
InputStream content
content may be null to indicate that there is no content to be read.
So I suppose that it actually IS essentially the same level of complexity! :-)