다음을 통해 공유


CharsetEncoder Constructors

Definition

Overloads

CharsetEncoder(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

CharsetEncoder(Charset, Single, Single)

Initializes a new encoder.

CharsetEncoder(Charset, Single, Single, Byte[])

Initializes a new encoder.

CharsetEncoder(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected CharsetEncoder (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Java.Nio.Charset.CharsetEncoder : nativeint * Android.Runtime.JniHandleOwnership -> Java.Nio.Charset.CharsetEncoder

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

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

CharsetEncoder(Charset, Single, Single)

Initializes a new encoder.

[Android.Runtime.Register(".ctor", "(Ljava/nio/charset/Charset;FF)V", "")]
protected CharsetEncoder (Java.Nio.Charset.Charset? cs, float averageBytesPerChar, float maxBytesPerChar);
[<Android.Runtime.Register(".ctor", "(Ljava/nio/charset/Charset;FF)V", "")>]
new Java.Nio.Charset.CharsetEncoder : Java.Nio.Charset.Charset * single * single -> Java.Nio.Charset.CharsetEncoder

Parameters

cs
Charset

The charset that created this encoder

averageBytesPerChar
Single

A positive float value indicating the expected number of bytes that will be produced for each input character

maxBytesPerChar
Single

A positive float value indicating the maximum number of bytes that will be produced for each input character

Attributes

Remarks

Initializes a new encoder. The new encoder will have the given bytes-per-char values and its replacement will be the byte array {&nbsp;(byte)'?'&nbsp;}.

Java documentation for java.nio.charset.CharsetEncoder.CharsetEncoder(java.nio.charset.Charset, float, float).

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

CharsetEncoder(Charset, Single, Single, Byte[])

Initializes a new encoder.

[Android.Runtime.Register(".ctor", "(Ljava/nio/charset/Charset;FF[B)V", "")]
protected CharsetEncoder (Java.Nio.Charset.Charset? cs, float averageBytesPerChar, float maxBytesPerChar, byte[]? replacement);
[<Android.Runtime.Register(".ctor", "(Ljava/nio/charset/Charset;FF[B)V", "")>]
new Java.Nio.Charset.CharsetEncoder : Java.Nio.Charset.Charset * single * single * byte[] -> Java.Nio.Charset.CharsetEncoder

Parameters

cs
Charset

The charset that created this encoder

averageBytesPerChar
Single

A positive float value indicating the expected number of bytes that will be produced for each input character

maxBytesPerChar
Single

A positive float value indicating the maximum number of bytes that will be produced for each input character

replacement
Byte[]

The initial replacement; must not be null, must have non-zero length, must not be longer than maxBytesPerChar, and must be #isLegalReplacement legal

Attributes

Exceptions

if any parameters are invalid.

Remarks

Initializes a new encoder. The new encoder will have the given bytes-per-char and replacement values.

Java documentation for java.nio.charset.CharsetEncoder.CharsetEncoder(java.nio.charset.Charset, float, float, 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