/// <summary>Creates new instance of SessionOutputBufferImpl.</summary>
 /// <remarks>Creates new instance of SessionOutputBufferImpl.</remarks>
 /// <param name="metrics">HTTP transport metrics.</param>
 /// <param name="buffersize">buffer size. Must be a positive number.</param>
 /// <param name="fragementSizeHint">
 /// fragment size hint defining a minimal size of a fragment
 /// that should be written out directly to the socket bypassing the session buffer.
 /// Value <code>0</code> disables fragment buffering.
 /// </param>
 /// <param name="charencoder">
 /// charencoder to be used for encoding HTTP protocol elements.
 /// If <code>null</code> simple type cast will be used for char to byte conversion.
 /// </param>
 internal SessionOutputBufferImpl(HttpTransportMetricsImpl metrics, int buffersize,
                                  int fragementSizeHint, CharsetEncoder charencoder) : base()
 {
     Args.Positive(buffersize, "Buffer size");
     Args.NotNull(metrics, "HTTP transport metrcis");
     this.metrics           = metrics;
     this.buffer            = new ByteArrayBuffer(buffersize);
     this.fragementSizeHint = fragementSizeHint >= 0 ? fragementSizeHint : 0;
     this.encoder           = charencoder;
 }
 /// <summary>Creates new instance of SessionInputBufferImpl.</summary>
 /// <remarks>Creates new instance of SessionInputBufferImpl.</remarks>
 /// <param name="metrics">HTTP transport metrics.</param>
 /// <param name="buffersize">buffer size. Must be a positive number.</param>
 /// <param name="minChunkLimit">
 /// size limit below which data chunks should be buffered in memory
 /// in order to minimize native method invocations on the underlying network socket.
 /// The optimal value of this parameter can be platform specific and defines a trade-off
 /// between performance of memory copy operations and that of native method invocation.
 /// If negative default chunk limited will be used.
 /// </param>
 /// <param name="constraints">
 /// Message constraints. If <code>null</code>
 /// <see cref="Org.Apache.Http.Config.MessageConstraints.Default">Org.Apache.Http.Config.MessageConstraints.Default
 ///     </see>
 /// will be used.
 /// </param>
 /// <param name="chardecoder">
 /// chardecoder to be used for decoding HTTP protocol elements.
 /// If <code>null</code> simple type cast will be used for byte to char conversion.
 /// </param>
 internal SessionInputBufferImpl(HttpTransportMetricsImpl metrics, int buffersize, int
                                 minChunkLimit, MessageConstraints constraints, CharsetDecoder chardecoder)
 {
     Args.NotNull(metrics, "HTTP transport metrcis");
     Args.Positive(buffersize, "Buffer size");
     this.metrics       = metrics;
     this.buffer        = new byte[buffersize];
     this.bufferpos     = 0;
     this.bufferlen     = 0;
     this.minChunkLimit = minChunkLimit >= 0 ? minChunkLimit : 512;
     this.constraints   = constraints != null ? constraints : MessageConstraints.Default;
     this.linebuffer    = new ByteArrayBuffer(buffersize);
     this.decoder       = chardecoder;
 }
 public SessionInputBufferImpl(HttpTransportMetricsImpl metrics, int buffersize) :
     this(metrics, buffersize, buffersize, null, null)
 {
 }