Allows encoding without necessarily outputting to a file or stream. Useful for running encoding tests.