Support for chunked encoding and decoding