JsonStringEscapingSink class

A proxy StringSink that intercepts writes, safely escapes them for JSON, and forwards the raw escaped characters to an underlying sink.

This is particularly useful for streaming large text payloads directly into a JSON string field without buffering the entire string in memory.

Implemented types

Constructors

JsonStringEscapingSink(StringSink _inner)
Creates a JsonStringEscapingSink that writes escaped characters to _inner.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
write(Object? object) → void
Writes the string representation of object.
override
writeAll(Iterable objects, [String separator = ""]) → void
Writes the elements of objects separated by separator.
override
writeCharCode(int charCode) → void
Writes a string containing the character with code point charCode.
override
writeln([Object? object = ""]) → void
Writes the string representation of object followed by a newline.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited