#nullable enable
/**
* DpJsonProtocol — 레거시 호환 JSON 프로토콜. DpProtocolLibrary 모듈화.
* Thrift/내부 전송용; 타입 래퍼(i64/str/tf/lst 등) 포함. 설정/OpenAPI 라운드트립은 Deuk JSON/YAML 사용.
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace DeukPack.Protocol
{
///
/// Legacy-compatible JSON protocol (TJSONProtocol-compatible).
/// Uses type wrappers for wire/Thrift compatibility. For config/OpenAPI round-trip use Deuk JSON/YAML.
/// Stream-based; constructor(stream, includeSchema, isReadMode).
///
public class DpJsonProtocol : DpProtocol, IDisposable
{
private readonly Stream _stream;
private readonly bool _isReadMode;
private readonly bool _includeSchema;
private readonly bool _pretty;
private readonly Stack _writeStack;
private class ListWriteState { public List