summary refs log tree commit diff
path: root/crypto/src/cms/CMSProcessableByteArray.cs
blob: a6ab9b6a27bd6b8da40401782ab802b098e6921f (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
using System;
using System.IO;

namespace Org.BouncyCastle.Cms
{
	/**
	* a holding class for a byte array of data to be processed.
	*/
	public class CmsProcessableByteArray
		: CmsProcessable, CmsReadable
	{
		private readonly byte[] bytes;

        public CmsProcessableByteArray(byte[] bytes)
		{
			this.bytes = bytes;
		}

        public virtual Stream GetInputStream()
		{
			return new MemoryStream(bytes, false);
		}

        public virtual void Write(Stream zOut)
		{
			zOut.Write(bytes, 0, bytes.Length);
		}

        /// <returns>A clone of the byte array</returns>
        [Obsolete]
		public virtual object GetContent()
		{
			return bytes.Clone();
		}
	}
}