Fix chunking bug when writing zero bytes
Fix chunking issue when write() is called with empty buffer
Fix up fluent API
Fix chunking bug when flush is called followed by writeFinal()