Difference between revisions of "System.JSON.TJSONObject.ToBytes"

From RAD Studio API Documentation
Jump to: navigation, search
(RS-56859)
(RS-56859)
 
Line 24: Line 24:
 
|}
 
|}
  
<blockquote>'''Note:'''  We recommend that the container capacity be determined using a call to [[System.JSON.TJSONObject.EstimatedByteSize|EstimatedByteSize]]. </blockquote>
+
<blockquote>'''Note:'''  We recommend using [[System.JSON.TJSONObject.EstimatedByteSize|EstimatedByteSize]] to determine the container capacity.</blockquote>
  
 
To serialize the JSON object into a string, use the [[System.JSON.TJSONObject.ToString|ToString]] method.  
 
To serialize the JSON object into a string, use the [[System.JSON.TJSONObject.ToString|ToString]] method.  

Latest revision as of 10:12, 4 September 2015

Delphi

function ToBytes(const Data: TArray<Byte>; const Idx: Integer): Integer; override;

C++

virtual int __fastcall ToBytes(const System::DynamicArray<System::Byte> Data, const int Idx);

Properties

Type Visibility Source Unit Parent
function public
System.JSON.pas
System.JSON.hpp
System.JSON TJSONObject

Description

Serializes the current JSON object content into an array of bytes.

ToBytes writes a byte representation of the current JSON object content into the specified Data byte array beginning from the Idx element. ToBytes returns the actual size of the Data array. ToBytes assumes that the byte container has sufficient capacity.

The parameters are described in the table below.

Parameter Meaning

Data

Byte container

Idx

Offset from which JSON object is serialized into the Data array.

Note: We recommend using EstimatedByteSize to determine the container capacity.

To serialize the JSON object into a string, use the ToString method.

See Also