Modified the compressor to write into a writer instead of a buffer

This will allow you to write compressed data directly into a socket,
file or as before a string. This makes it slightly more flexible.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>