// 读前准备( 创建指针字典, 并不重置 读长度限制 ) public void BeginRead() { if (idxStore == null) { idxStore = new Dict <uint, object>(); } else { idxStore.Clear(); } offsetRoot = offset; }
// 写前准备( 创建指针字典, 存起始 offset ) public void BeginWrite() { if (ptrStore == null) { ptrStore = new Dict <object, uint>(); } else { ptrStore.Clear(); } offsetRoot = dataLen; }
// 将 v 转为 string( json 长相 ) public string ToString <T>(T v) where T : IObject { objOffsets.Clear(); sb.Clear(); if (v == null) { sb.Append("null"); } else { v.ToString(this); } return(sb.ToString()); }
public void Clear() { d0.Clear(); d1.Clear(); }