Unit 'JsonWriter' Package
[Overview][Classes][Index] [#fcl]

TJSONStreamWriter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

JSON writer that writes directly to a stream

Declaration

Source position: jsonwriter.pp line 102

type TJSONStreamWriter = class(TAbstractJSONWriter)

public

  constructor create();

  

Create a new stream writer for the given stream

  procedure WriteValue();

  

Write a JSON value directly to the stream

  procedure StartProperty(); override;

  

Start writing a property in a JSON object

  procedure EndProperty; override;

  

End writing a property in a JSON object

  procedure StartArray; override;

  

Start writing a JSON array

  procedure EndArray; override;

  

End writing a JSON array

  procedure NextElement; override;

  

Prepare for the next element in a JSON array

  procedure StartObject; override;

  

Start writing a JSON object

  procedure EndObject; override;

  

End writing a JSON object

  procedure Flush; override;

  

Flush any pending output to the stream

  property StrictStrings: Boolean; [rw]

  

Control strict JSON string encoding

end;

Inheritance

TJSONStreamWriter

  

JSON writer that writes directly to a stream

|

TAbstractJSONWriter

  

Abstract base class for JSON writers

|

TObject

Description

TJSONStreamWriter is a JSON writer implementation that writes JSON text directly to a stream without building an in-memory data structure. This writer is memory-efficient for large JSON files as it streams the output directly. It maintains element counters to properly format arrays and objects with correct comma placement.

See also

TAbstractJSONWriter

  

Abstract base class for JSON writers

TJSONDataWriter

  

JSON writer that builds TJSONData tree in memory

StrictStrings

  

Control strict JSON string encoding

TStream


Documentation generated on: Jan 27 2026