String.GetBytes String.GetBytes Method

Definition

Overloads

GetBytes() GetBytes()

Returns a new byte array containing the code points in this string encoded using the system's DefaultCharset().

GetBytes(Charset) GetBytes(Charset)

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

GetBytes(String) GetBytes(String)

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

GetBytes(Int32, Int32, Byte[], Int32) GetBytes(Int32, Int32, Byte[], Int32)

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

GetBytes() GetBytes()

Returns a new byte array containing the code points in this string encoded using the system's DefaultCharset().

[Android.Runtime.Register("getBytes", "()[B", "")]
public byte[] GetBytes ();
member this.GetBytes : unit -> byte[]

Returns

Byte[]

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.

GetBytes(Charset) GetBytes(Charset)

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

[Android.Runtime.Register("getBytes", "(Ljava/nio/charset/Charset;)[B", "", ApiSince=9)]
public byte[] GetBytes (Java.Nio.Charset.Charset charset);
member this.GetBytes : Java.Nio.Charset.Charset -> byte[]

Parameters

charset
Charset Charset

Returns

Byte[]

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.

GetBytes(String) GetBytes(String)

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

[Android.Runtime.Register("getBytes", "(Ljava/lang/String;)[B", "")]
public byte[] GetBytes (string charsetName);
member this.GetBytes : string -> byte[]

Parameters

charsetName
String String

Returns

Byte[]

Exceptions

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.

GetBytes(Int32, Int32, Byte[], Int32) GetBytes(Int32, Int32, Byte[], Int32)

Warning

This API is now obsolete.

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

[Android.Runtime.Register("getBytes", "(II[BI)V", "")]
[System.Obsolete("deprecated")]
public void GetBytes (int srcBegin, int srcEnd, byte[] dst, int dstBegin);
member this.GetBytes : int * int * byte[] * int -> unit

Parameters

srcBegin
Int32 Int32
srcEnd
Int32 Int32
dst
Byte[]
dstBegin
Int32 Int32

Exceptions

if start , end > length(), index or end - start > data.length - index.

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