Allow passing IO objects to Encoder