blob: df31d71f014293ad9de541a050cde7395d07774c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
using System;
using System.IO;
using Org.BouncyCastle.Utilities.IO;
namespace Org.BouncyCastle.Bcpg.OpenPgp
{
internal sealed class WrappedGeneratorStream
: FilterStream
{
private IStreamGenerator m_generator;
internal WrappedGeneratorStream(IStreamGenerator generator, Stream s)
: base(s)
{
if (generator == null)
throw new ArgumentNullException(nameof(generator));
m_generator = generator;
}
protected override void Dispose(bool disposing)
{
if (m_generator != null)
{
if (disposing)
{
m_generator.Close();
}
m_generator = null;
}
// Don't dispose the wrapped Stream
if (!disposing)
{
base.Dispose(disposing);
}
}
}
}
|