CharsetEncoder.IsLegalReplacement(Byte[]) Method

Definition

Tells whether or not the given byte array is a legal replacement value for this encoder.

[Android.Runtime.Register("isLegalReplacement", "([B)Z", "GetIsLegalReplacement_arrayBHandler")]
public virtual bool IsLegalReplacement (byte[]? repl);
[<Android.Runtime.Register("isLegalReplacement", "([B)Z", "GetIsLegalReplacement_arrayBHandler")>]
abstract member IsLegalReplacement : byte[] -> bool
override this.IsLegalReplacement : byte[] -> bool

Parameters

repl
Byte[]

The byte array to be tested

Returns

true if, and only if, the given byte array is a legal replacement value for this encoder

Attributes

Remarks

Tells whether or not the given byte array is a legal replacement value for this encoder.

A replacement is legal if, and only if, it is a legal sequence of bytes in this encoder's charset; that is, it must be possible to decode the replacement into one or more sixteen-bit Unicode characters.

The default implementation of this method is not very efficient; it should generally be overridden to improve performance.

Java documentation for java.nio.charset.CharsetEncoder.isLegalReplacement(byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to