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

namespace Org.BouncyCastle.Bcpg
{
	/// <remarks>Basic packet for an experimental packet.</remarks>
    public class ExperimentalPacket
        : ContainedPacket
    {
        private readonly PacketTag m_tag;
        private readonly byte[] m_contents;

		internal ExperimentalPacket(PacketTag tag, BcpgInputStream bcpgIn)
        {
            m_tag = tag;
			m_contents = bcpgIn.ReadAll();
        }

		public PacketTag Tag => m_tag;

		public byte[] GetContents() => (byte[])m_contents.Clone();

		public override void Encode(BcpgOutputStream bcpgOut)
        {
            bcpgOut.WritePacket(m_tag, m_contents);
        }
    }
}