Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
Things to check
Flags
safe-html, strict-same
Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
In situations where serializing a <<ref_value>> in its entirety is inefficient or even impossible, <<ref_serializer>> can be used to serialize a <<ref_value>> incrementally. This may be done for a variety of reasons, such as to avoid buffering the entire output, or to ensure that a fixed amount of work is performed in each cycle. Instances of <<ref_serializer>> maintain an output state using internal dynamically allocated structures, with an interface to retrieve successive buffers of the serialized output into a caller provided buffer. Here is an example, demonstrating how <<ref_operator_lt_lt>> may be implemented using a <<在完整序列化一个 <<ref_value>> 效率低下甚至不可行的情况下,可使用 <<ref_serializer>> 对其进行逐步序列化。这样做有多种原因,例如避免缓冲整个输出,或确保每个周期执行固定量的工作。<<ref_serializer>> 的实例通过内部动态分配的结构维护输出状态,并提供接口,将序列化输出的连续缓冲区写入调用方提供的缓冲区中。以下示例展示了如何使用 <<ref_serializer>> 来实现 <<ref_operator_lt_lt>>:</ref_operator_lt_lt></ref_serializer></ref_serializer></ref_serializer></ref_value>: