e79aa3c0ed
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
48 lines
1.7 KiB
C#
48 lines
1.7 KiB
C#
//------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//------------------------------------------------------------
|
|
|
|
namespace System.IdentityModel
|
|
{
|
|
using System;
|
|
using System.Runtime;
|
|
|
|
class BufferManagerOutputStream : BufferedOutputStream
|
|
{
|
|
string quotaExceededString;
|
|
|
|
public BufferManagerOutputStream(string quotaExceededString)
|
|
: base()
|
|
{
|
|
this.quotaExceededString = quotaExceededString;
|
|
}
|
|
|
|
public BufferManagerOutputStream(string quotaExceededString, int maxSize)
|
|
: base(maxSize)
|
|
{
|
|
this.quotaExceededString = quotaExceededString;
|
|
}
|
|
|
|
public BufferManagerOutputStream(string quotaExceededString, int initialSize, int maxSize, BufferManager bufferManager)
|
|
: base(initialSize, maxSize, BufferManager.GetInternalBufferManager(bufferManager))
|
|
{
|
|
this.quotaExceededString = quotaExceededString;
|
|
}
|
|
|
|
public void Init(int initialSize, int maxSizeQuota, BufferManager bufferManager)
|
|
{
|
|
Init(initialSize, maxSizeQuota, maxSizeQuota, bufferManager);
|
|
}
|
|
|
|
public void Init(int initialSize, int maxSizeQuota, int effectiveMaxSize, BufferManager bufferManager)
|
|
{
|
|
base.Reinitialize(initialSize, maxSizeQuota, effectiveMaxSize, BufferManager.GetInternalBufferManager(bufferManager));
|
|
}
|
|
|
|
protected override Exception CreateQuotaExceededException(int maxSizeQuota)
|
|
{
|
|
return new LimitExceededException(SR.GetString(this.quotaExceededString, maxSizeQuota));
|
|
}
|
|
}
|
|
}
|