/// <summary> /// Initializes a new instance of the <see cref="ResponseEncoder"/> class. /// </summary> /// <param name="mapper">Used to find content id for the send objects.</param> /// <param name="encoder">Serializes the sent object.</param> public ResponseEncoder(ContentMapper mapper, IContentEncoder encoder) { if (mapper == null) throw new ArgumentNullException("mapper"); if (encoder == null) throw new ArgumentNullException("encoder"); _mapper = mapper; _encoder = encoder; }
/// <summary> /// Initializes a new instance of the <see cref="ContentDecoder"/> class. /// </summary> /// <param name="mapper">Used to determine which packets to deserialize.</param> /// <param name="bufferPool">Used to store packet bytes before deserialization.</param> /// <param name="decoder">Used to deserialize the backet bytes..</param> public ContentDecoder(ContentMapper mapper, BufferPool bufferPool, IContentDecoder decoder) { if (mapper == null) throw new ArgumentNullException("mapper"); if (bufferPool == null) throw new ArgumentNullException("bufferPool"); if (decoder == null) throw new ArgumentNullException("decoder"); _mapper = mapper; _bufferPool = bufferPool; _decoder = decoder; }