Share via


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

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Encodes a set of characters from the specified String into the specified byte array.

Namespace:  System.Text
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Overrides Function GetBytes ( _
    s As String, _
    charIndex As Integer, _
    charCount As Integer, _
    bytes As Byte(), _
    byteIndex As Integer _
) As Integer
public override int GetBytes(
    string s,
    int charIndex,
    int charCount,
    byte[] bytes,
    int byteIndex
)
public:
virtual int GetBytes(
    String^ s, 
    int charIndex, 
    int charCount, 
    array<unsigned char>^ bytes, 
    int byteIndex
) override
abstract GetBytes : 
        s:string * 
        charIndex:int * 
        charCount:int * 
        bytes:byte[] * 
        byteIndex:int -> int 
override GetBytes : 
        s:string * 
        charIndex:int * 
        charCount:int * 
        bytes:byte[] * 
        byteIndex:int -> int 
public override function GetBytes(
    s : String, 
    charIndex : int, 
    charCount : int, 
    bytes : byte[], 
    byteIndex : int
) : int

Parameters

  • bytes
    Type: array<System. . :: . .Byte> [] () [] []
    The byte array to contain the resulting sequence of bytes.
  • byteIndex
    Type: System. . :: . .Int32
    The index at which to start writing the resulting sequence of bytes.

Return Value

Type: System. . :: . .Int32
The actual number of bytes written into bytes.

.NET Framework Security

See Also

Reference

UTF8Encoding Class

GetBytes Overload

System.Text Namespace