Adding Encoder type and Encoder.Encode() method.