Пример #1
0
            public Builder SerializationBufferSize(int bufferSize)
            {
                SAssert.ArgumentPositive(() => bufferSize);

                _settings.SerializationBufferSize = bufferSize;
                return(this);
            }
Пример #2
0
            public Builder EncodingBufferSize(int bufferSize)
            {
                SAssert.ArgumentPositive(() => bufferSize);

                _settings.EncodingBufferSize = bufferSize;
                return(this);
            }
Пример #3
0
            public Builder MaxReconnectRetries(int maxRetries)
            {
                SAssert.ArgumentPositive(() => maxRetries);
                SAssert.IsTrue(_settings.ReconnectOnIdle, () =>
                               new ArgumentException("MaxReconnectRetries requires ReconnectOnIdle"));

                _settings.MaxReconnectRetries = maxRetries;
                return(this);
            }
Пример #4
0
        public void ReadBulkTo(Stream target, int bulkLength, int bufferSize)
        {
            SAssert.ArgumentNotNull(() => target);
            SAssert.ArgumentNonNegative(() => bulkLength);
            SAssert.ArgumentPositive(() => bufferSize);

            using (var limiter = new LimitingStream(_stream, bulkLength))
                limiter.CopyTo(target);

            readCrLf();
        }