From d032037615fb28980f2d92dbe500fc2fcfdd37ee Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sun, 18 Oct 2015 11:33:33 +0700 Subject: http://www.bouncycastle.org/jira/browse/BMA-90 - Make CmsReadable public - Make a few methods virtual --- crypto/src/cms/CMSProcessableInputStream.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'crypto/src/cms/CMSProcessableInputStream.cs') diff --git a/crypto/src/cms/CMSProcessableInputStream.cs b/crypto/src/cms/CMSProcessableInputStream.cs index 7fdd1dfef..6dff7c212 100644 --- a/crypto/src/cms/CMSProcessableInputStream.cs +++ b/crypto/src/cms/CMSProcessableInputStream.cs @@ -8,23 +8,23 @@ namespace Org.BouncyCastle.Cms public class CmsProcessableInputStream : CmsProcessable, CmsReadable { - private Stream input; - private bool used = false; + private readonly Stream input; - public CmsProcessableInputStream( - Stream input) + private bool used = false; + + public CmsProcessableInputStream(Stream input) { this.input = input; } - public Stream GetInputStream() + public virtual Stream GetInputStream() { CheckSingleUsage(); - return input; + return input; } - public void Write(Stream output) + public virtual void Write(Stream output) { CheckSingleUsage(); @@ -32,20 +32,20 @@ namespace Org.BouncyCastle.Cms input.Close(); } - [Obsolete] - public object GetContent() + [Obsolete] + public virtual object GetContent() { return GetInputStream(); } - private void CheckSingleUsage() + protected virtual void CheckSingleUsage() { lock (this) { if (used) throw new InvalidOperationException("CmsProcessableInputStream can only be used once"); - used = true; + used = true; } } } -- cgit 1.5.1