System.JSON.TJSONAncestor.ToBytes
Delphi
function ToBytes(const Data: TArray<Byte>; Offset: Integer): Integer; virtual; abstract;
C++
virtual int __fastcall ToBytes(const System::DynamicArray<System::Byte> Data, int Offset) = 0 ;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.JSON.pas System.JSON.hpp |
System.JSON | TJSONAncestor |
Description
Declares the method to serialize the JSON object content into array of bytes.
Descendant classes should implement ToBytes providing the following functionality. ToBytes serializes the JSON object content into the given Data
byte array beginning from the Offset
element and returns the actual size of the Data
array. ToBytes assumes that the byte container has sufficient capacity to store it.
The parameters are described in the table below.
Parameter | Meaning |
---|---|
Data |
Byte container - an array of bytes. |
Offset |
Offset from which the data is written into the |
Note: We recommend using EstimatedByteSize to determine the container capacity.