Java.Lang.String.GetBytes Method
Returns a new byte array containing the code points of this string encoded using the named charset.

Syntax

[Android.Runtime.Register("getBytes", "(Ljava/lang/String;)[B", "")]
public byte[] GetBytes (string encoding)

Parameters

charsetName
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.IO.UnsupportedEncodingExceptionif the charset is not supported

Remarks

Returns a new byte array containing the code points of this string encoded using the named charset.

The behavior when this string cannot be represented in the named charset is unspecified. Use Java.Nio.Charset.CharsetEncoder 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