replaceWith

fun replaceWith(newReplacement: ByteArray): CharsetEncoder

Changes this encoder's replacement value.

This method invokes the .implReplaceWith method, passing the new replacement, after checking that the new replacement is acceptable.

Return

This encoder

Parameters

newReplacement

The new replacement; must not be null, must have non-zero length,

must not be longer than the value returned by the .maxBytesPerChar method, and must be .isLegalReplacement

Throws

If the preconditions on the parameter do not hold