01: package org.bouncycastle.bcpg;
02:
03: import java.io.*;
04:
05: /**
06: * Basic type for a PGP packet.
07: */
08: public abstract class ContainedPacket extends Packet {
09: public byte[] getEncoded() throws IOException {
10: ByteArrayOutputStream bOut = new ByteArrayOutputStream();
11: BCPGOutputStream pOut = new BCPGOutputStream(bOut);
12:
13: pOut.writePacket(this );
14:
15: return bOut.toByteArray();
16: }
17:
18: public abstract void encode(BCPGOutputStream pOut)
19: throws IOException;
20: }
|