Implement Encoding#replicate