API:System.SysUtils.TUnicodeEncoding.GetBytes
Delphi
function GetBytes(Chars: PChar; CharCount: Integer; Bytes: PByte; ByteCount: Integer): Integer; overload; override;
C++
virtual int __fastcall GetBytes(System::WideChar * Chars, int CharCount, System::PByte Bytes, int ByteCount)/* overload */;
inline System::DynamicArray<System::Byte> __fastcall GetBytes(const System::WideChar Chars){ return TEncoding::GetBytes(Chars); }
inline System::DynamicArray<System::Byte> __fastcall GetBytes(const System::WideChar *Chars, const int Chars_High){ return TEncoding::GetBytes(Chars, Chars_High); }
inline System::DynamicArray<System::Byte> __fastcall GetBytes(const System::DynamicArray<System::WideChar> Chars){ return TEncoding::GetBytes(Chars); }
inline System::DynamicArray<System::Byte> __fastcall GetBytes(const System::WideChar *Chars, const int Chars_High, int CharIndex, int CharCount){ return TEncoding::GetBytes(Chars, Chars_High, CharIndex, CharCount); }
inline System::DynamicArray<System::Byte> __fastcall GetBytes(const System::DynamicArray<System::WideChar> Chars, int CharIndex, int CharCount){ return TEncoding::GetBytes(Chars, CharIndex, CharCount); }
inline int __fastcall GetBytes(const System::WideChar *Chars, const int Chars_High, int CharIndex, int CharCount, const System::DynamicArray<System::Byte> Bytes, int ByteIndex){ return TEncoding::GetBytes(Chars, Chars_High, CharIndex, CharCount, Bytes, ByteIndex); }
inline int __fastcall GetBytes(const System::DynamicArray<System::WideChar> Chars, int CharIndex, int CharCount, const System::DynamicArray<System::Byte> Bytes, int ByteIndex){ return TEncoding::GetBytes(Chars, CharIndex, CharCount, Bytes, ByteIndex); }
inline System::DynamicArray<System::Byte> __fastcall GetBytes(const System::UnicodeString S){ return TEncoding::GetBytes(S); }
inline int __fastcall GetBytes(const System::UnicodeString S, int CharIndex, int CharCount, const System::DynamicArray<System::Byte> Bytes, int ByteIndex){ return TEncoding::GetBytes(S, CharIndex, CharCount, Bytes, ByteIndex); }
inline int __fastcall GetBytes(const System::UnicodeString S, int CharIndex, int CharCount, const System::DynamicArray<System::Byte> Bytes, int ByteIndex, const int StringBaseIndex){ return TEncoding::GetBytes(S, CharIndex, CharCount, Bytes, ByteIndex, StringBaseIndex); }
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | class protected public |
System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | TUnicodeEncoding |
Description
Encodes a set of characters from the specified string or characters.
System.SysUtils.TUnicodeEncoding.GetBytes inherits from System.SysUtils.TEncoding.GetBytes. All content below this line refers to System.SysUtils.TEncoding.GetBytes.
Encodes a set of characters from the specified string or characters.
function GetBytes(Chars: PChar; CharCount: Integer; Bytes: PByte; ByteCount: Integer): Integer; overload; virtual; abstract;
- This overload version is an abstract method in this class. Actual implementation is deferred to a descendent classs.
function GetBytes(const Chars: Char): TBytes; overload;
- Encodes and returns a Chars character as a sequence of bytes.
- Chars: One UNICODE character that to encode.
- Return Value is a byte array containing the results of encoding the specified character sequence.
function GetBytes(const Chars: array of Char): TBytes; overload;
function GetBytes(const Chars: TCharArray): TBytes; overload;
- Encodes and returns the sequence of characters of Chars array as a sequence of bytes.
- Chars: array of char that contains the set of characters to encode.
- Return Value is a byte array containing the results of encoding the specified character sequence.
function GetBytes(const Chars: array of Char; CharIndex, CharCount: Integer): TBytes; overload;
function GetBytes(const Chars: TCharArray; CharIndex, CharCount: Integer): TBytes; overload;
- Encodes and returns the sequence of CharCount characters from CharIndex of Chars array as a sequence of bytes.
- Chars: array of char that contains the set of characters to encode.
- CharIndex: index of the first character to encode on Chars array.
- CharCount: parameter that specifies the number of characters to encode.
- Return Value is a byte array containing the results of encoding the specified character sequence.
function GetBytes(const Chars: array of Char; CharIndex, CharCount: Integer; const Bytes: TBytes; ByteIndex: Integer): Integer; overload;
function GetBytes(const Chars: TCharArray; CharIndex, CharCount: Integer; const Bytes: TBytes; ByteIndex: Integer): Integer; overload;
- Encodes the sequence of CharCount characters from CharIndex of Chars into Bytes as a sequence of bytes.
- Chars: array of char that contains the set of characters to encode.
- CharIndex: index of the first character to encode on Chars array.
- CharCount: parameter that specifies the number of characters to encode.
- Bytes: byte array that contains the resulting sequence of bytes. It specifies the location where the sequence of bytes is recorded.
- Return Value is the actual number of bytes written into Bytes.
function GetBytes(const S: string): TBytes; overload;
- Encodes and returns S string as a sequence of bytes.
- S: string that contains the set of characters to encode.
- Return Value is a byte array containing the results of encoding the specified string.
function GetBytes(const S: string; CharIndex, CharCount: Integer; const Bytes: TBytes; ByteIndex: Integer): Integer; overload;
- Encodes CharCount characters from CharIndex index of string S into Bytes array with ByteIndex offset as a sequence of bytes. CharIndex is one-based index on Desktop platforms including Windows, Mac OS X, and Linux, or zero-based on Mobile platforms including iOS and Android.
- S: string that contains the set of characters to encode.
- CharIndex: index of the first character to encode. On Desktop platforms including Windows, Mac OS X, and Linux, CharIndex is one-based. On Mobile platforms including iOS and Android, CharIndex is zero-based.
- CharCount: parameter that specifies the number of characters to encode.
- Bytes: byte array that contains the resulting sequence of bytes. It specifies the location where the sequence of bytes is recorded.
- ByteIndex: index starting from which the resulting sequence of bytes is recorded.
- Return Value is the actual number of bytes written into Bytes.
function GetBytes(const S: string; CharIndex, CharCount: Integer; const Bytes: TBytes; ByteIndex: Integer; const StringBaseIndex: Integer): Integer; overload;
- Encodes CharCount characters from CharIndex index of string S into Bytes array with ByteIndex offset as a sequence of bytes. StringBaseIndex is the base index number; 0 or 1 of CharIndex on the S string.
- S: string that contains the set of characters to encode.
- CharIndex: index of the first character to encode. Index base is controlled by StringBaseIndex
- CharCount: parameter that specifies the number of characters to encode.
- Bytes: byte array that contains the resulting sequence of bytes. It specifies the location where the sequence of bytes is recorded.
- ByteIndex: index starting from which the resulting sequence of bytes is recorded.
- StringBaseIndex: base index number of CharIndex on the s string. This value is 0 or 1. If other number is specified, EEncodingError exception is raised.
- Return Value is the actual number of bytes written into Bytes.
See Also