use EncoderFactory to new BinaryEncoder and JsonEncoder