System.JSON.TJSONString.ToBytes
Delphi
function ToBytes(const Data: TArray<Byte>; Offset: Integer): Integer; override;
C++
virtual int __fastcall ToBytes(const System::DynamicArray<System::Byte> Data, int Offset);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.JSON.pas System.JSON.hpp |
System.JSON | TJSONString |
Description
Serializes the current JSON string value into an array of bytes.
ToBytes writes a byte representation of the current the JSON string into the given Data
byte array beginning from the Idx
element.
ToBytes returns the actual Data
size used. ToBytes assumes that the byte container has sufficient capacity to store data.
The parameters are described in the table below.
Parameter | Meaning |
---|---|
Data |
Byte container |
Idx |
Offset from which the JSON string is serialized |
Note: We recommend using EstimatedByteSize to determine the container capacity.
To serialize the JSON array into a string, use the ToString method.