Android Guides | Samples

Java.Lang.String Constructor

Converts the byte array to a string using the named charset.

Syntax

[Android.Runtime.Register(".ctor", "([BIILjava/lang/String;)V", "")]
public String (Byte[] data, Int32 start, Int32 length, String encoding)

Parameters

data
offset
byteCount
charsetName

Exceptions

TypeReason
NullPointerExceptionif data == null.
IndexOutOfBoundsExceptionif byteCount data.length.
UnsupportedEncodingExceptionif the named charset is not supported.

Remarks

Converts the byte array to a string using the named charset.

The behavior when the bytes cannot be decoded by the named charset is unspecified. Use CharsetDecoder for more control.

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1