Add streams support

Support direct decoding/encoding with io streams. Useful for network and file system access.