This documentation is archived and is not being maintained.

Encoding.GetBytes Method

Encodes all or part of a specified String or character array into a byte array.

Overload List

Encodes a specified character array into a byte array.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Overridable Function GetBytes(Char()) As Byte()
[C#] public virtual byte[] GetBytes(char[]);
[C++] public: virtual unsigned char GetBytes(__wchar_t __gc[]) __gc[];
[JScript] public function GetBytes(Char[]) : Byte[];

Encodes a specified String into an array of bytes.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Overridable Function GetBytes(String) As Byte()
[C#] public virtual byte[] GetBytes(string);
[C++] public: virtual unsigned char GetBytes(String*) __gc[];
[JScript] public function GetBytes(String) : Byte[];

Encodes a range of characters from a character array into a byte array.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Overridable Function GetBytes(Char(), Integer, Integer) As Byte()
[C#] public virtual byte[] GetBytes(char[], int, int);
[C++] public: virtual unsigned char GetBytes(__wchar_t __gc[], int, int) __gc[];
[JScript] public function GetBytes(Char[], int, int) : Byte[];

When overridden in a derived class, encodes a range of characters from a character array into a byte array.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public MustOverride Function GetBytes(Char(), Integer, Integer, Byte(), Integer) As Integer
[C#] public abstract int GetBytes(char[], int, int, byte[], int);
[C++] public: virtual int GetBytes(__wchar_t __gc[], int, int, unsigned char __gc[], int) = 0;
[JScript] public abstract function GetBytes(Char[], int, int, Byte[], int) : int;

Encodes the specified range of a String into the specified range of a byte array.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Overridable Function GetBytes(String, Integer, Integer, Byte(), Integer) As Integer
[C#] public virtual int GetBytes(string, int, int, byte[], int);
[C++] public: virtual int GetBytes(String*, int, int, unsigned char __gc[], int);
[JScript] public function GetBytes(String, int, int, Byte[], int) : int;

See Also

Encoding Class | Encoding Members | System.Text Namespace

Show: