| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using CoreWCF.Runtime; |
| | | 6 | | |
| | | 7 | | namespace CoreWCF.Channels |
| | | 8 | | { |
| | | 9 | | internal class BufferManagerOutputStream : BufferedOutputStream |
| | | 10 | | { |
| | | 11 | | private readonly string _quotaExceededString; |
| | | 12 | | |
| | | 13 | | public BufferManagerOutputStream(string quotaExceededString) |
| | 24 | 14 | | : base() |
| | | 15 | | { |
| | 24 | 16 | | _quotaExceededString = quotaExceededString; |
| | 24 | 17 | | } |
| | | 18 | | |
| | | 19 | | public BufferManagerOutputStream(string quotaExceededString, int initialSize, int maxSize, BufferManager bufferM |
| | 0 | 20 | | : base(initialSize, maxSize, bufferManager) |
| | | 21 | | { |
| | 0 | 22 | | _quotaExceededString = quotaExceededString; |
| | 0 | 23 | | } |
| | | 24 | | |
| | | 25 | | public void Init(int initialSize, int maxSizeQuota, BufferManager bufferManager) |
| | | 26 | | { |
| | 0 | 27 | | Init(initialSize, maxSizeQuota, maxSizeQuota, bufferManager); |
| | 0 | 28 | | } |
| | | 29 | | |
| | | 30 | | public void Init(int initialSize, int maxSizeQuota, int effectiveMaxSize, BufferManager bufferManager) |
| | | 31 | | { |
| | 24 | 32 | | Reinitialize(initialSize, maxSizeQuota, effectiveMaxSize, bufferManager); |
| | 24 | 33 | | } |
| | | 34 | | |
| | | 35 | | protected override Exception CreateQuotaExceededException(int maxSizeQuota) |
| | | 36 | | { |
| | 0 | 37 | | string excMsg = SR.Format(_quotaExceededString, maxSizeQuota); |
| | | 38 | | //if (TD.MaxSentMessageSizeExceededIsEnabled()) |
| | | 39 | | //{ |
| | | 40 | | // TD.MaxSentMessageSizeExceeded(excMsg); |
| | | 41 | | //} |
| | 0 | 42 | | return new QuotaExceededException(excMsg); |
| | | 43 | | } |
| | | 44 | | } |
| | | 45 | | } |