public void Reset(SmartBuffer buf, TypeModel model, SerializationContext context) { // if (dest == null) throw new ArgumentNullException("dest"); // if (!dest.CanWrite) throw new ArgumentException("Cannot write to stream", "dest"); //if (model == null) throw new ArgumentNullException("model"); #if OPTIMIZATION_NETWORK this._destBuf = buf; #else #endif this.ioBuffer = BufferPool.GetBuffer(); this.model = model; this.wireType = WireType.None; if (context == null) { context = SerializationContext.Default; } else { context.Freeze(); } this.context = context; NetCache.Clear(); }