Android Guides | Samples

Java.Lang.String.GetBytes Method

Mangles a subsequence of this string into a byte array by stripping the high order bits from each char.

Syntax

[Android.Runtime.Register("getBytes", "(II[BI)V", "")]
[System.Obsolete("deprecated")]
public Void GetBytes (Int32 start, Int32 end, Byte[] data, Int32 index)

Parameters

start
the start offset in this string.
end
the end+1 offset in this string.
data
the destination byte array.
index
the start offset in the destination byte array.

Exceptions

TypeReason
NullPointerExceptionif data is null.
IndexOutOfBoundsExceptionif start , end > length(), index or end - start > data.length - index.

Remarks

Mangles a subsequence of this string into a byte array by stripping the high order bits from each char. Use String.GetBytes or String.GetBytes(String) instead.

[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