streaming interface for decoder

This pull request allows the the decoder to be used as a writable stream, and be piped to.